aboutsummaryrefslogtreecommitdiffstats
path: root/build_tests.py
diff options
context:
space:
mode:
authorPhilipp A2019-12-07 17:28:13 +0100
committerPhilipp A2019-12-07 17:28:13 +0100
commitec53e5420b41725a14b9bf0fc5d89e90bcfb882d (patch)
tree01df1e02613143c641db485ffd27dff31a79f32a /build_tests.py
parentbcb2ef27cb6cf46641e9c1c72aa0eb3d8322b312 (diff)
downloadrust-rst-ec53e5420b41725a14b9bf0fc5d89e90bcfb882d.tar.bz2
On second thought let’s not overcomplicate things
Diffstat (limited to 'build_tests.py')
-rw-r--r--build_tests.py27
1 files changed, 0 insertions, 27 deletions
diff --git a/build_tests.py b/build_tests.py
deleted file mode 100644
index 3fe4e9a..0000000
--- a/build_tests.py
+++ /dev/null
@@ -1,27 +0,0 @@
-import sys
-import json
-from ast import literal_eval
-from urllib.request import urlopen
-
-out = sys.argv[1]
-url_base = 'https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils'
-
-with urlopen(f'{url_base}/test/test_writers/test_html5_polyglot_parts.py?format=raw') as con:
- code = con.read().decode()
-
-code = code[code.find('totest ='):code.find('if __name__')]
-exec(code)
-with open(out, 'w') as f:
- t = 0
- for k, (opts, tests) in totest.items():
- for rst, result_code in tests:
- result = literal_eval(result_code)['fragment']
- rst, result = (r.replace('"', r'\"') for r in (rst, result))
- f.write(f'''\
-#[test]
-fn test_{t:02}() {{
- check_renders_to("{rst}", "{result.strip()}");
-}}
-''')
- t += 1
-