summaryrefslogtreecommitdiff
path: root/test/c/run_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/c/run_tests.py')
-rwxr-xr-xtest/c/run_tests.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/c/run_tests.py b/test/c/run_tests.py
index c31cc01b..47e7dc35 100755
--- a/test/c/run_tests.py
+++ b/test/c/run_tests.py
@@ -29,6 +29,20 @@ def test_c(name, c_opts, sail_opts, valgrind):
sys.exit()
return collect_results(name, tests)
+def test_interpreter(name):
+ banner('Testing {}'.format(name))
+ tests = {}
+ for filename in os.listdir('.'):
+ if re.match('.+\.sail', filename):
+ basename = os.path.splitext(os.path.basename(filename))[0]
+ tests[filename] = os.fork()
+ if tests[filename] == 0:
+ step('sail -is execute.isail -iout {}.iresult {}'.format(basename, filename))
+ step('diff {}.iresult {}.expect'.format(basename, basename))
+ print '{} {}{}{}'.format(filename, color.PASS, 'ok', color.END)
+ sys.exit()
+ return collect_results(name, tests)
+
xml = '<testsuites>\n'
xml += test_c('unoptimized C', '', '', True)
@@ -36,6 +50,8 @@ xml += test_c('optimized C', '-O2', '-O', True)
xml += test_c('constant folding', '', '-Oconstant_fold', True)
xml += test_c('address sanitised', '-O2 -fsanitize=undefined', '-O', False)
+xml += test_interpreter('interpreter')
+
xml += '</testsuites>\n'
output = open('tests.xml', 'w')