Commit 7e1569d7 authored by dbarbera's avatar dbarbera
Browse files

Refactor test execution

parent 4a26d7b3
EXAMPLES=$(sort $(dir $(wildcard */)))
TEST_CASES = \
test1 \
test2 \
test3 \
test4 \
test5 \
test6 \
test7 \
test8 \
test9 \
test10 \
test11 \
test12 \
test-controlflow \
test-exitnested \
test-expressions \
test-operators \
test-substrings \
test-parse:
@python test.py test-parse
@python test.py test-parse $(TEST_CASES)
test-ada:
@python test.py test-ada
@python test.py test-ada $(TEST_CASES)
test-llvm:
@python test.py test-llvm
@python test.py test-llvm $(TEST_CASES)
coverage:
for v in $(EXAMPLES) ; do make -C $$v coverage && mv $$v/.coverage* . \
for v in $(TEST_CASES) ; do make -C $$v coverage && mv $$v/.coverage* . \
|| exit 1 ; done ; coverage combine
clean:
for v in $(EXAMPLES); do make -C $$v clean ; done
for v in $(TEST_CASES); do make -C $$v clean ; done
.PHONY: test-parse test-ada test-llvm coverage clean
import os
import subprocess
import sys
import time
tests_folder = os.path.dirname(__file__)
paths = [
'test1',
'test2',
'test3',
'test4',
'test5',
'test6',
'test7',
'test8',
'test9',
'test10',
'test11',
'test12',
'test-controlflow',
'test-expressions',
'test-operators',
'test-substrings',
'test-exitnested',
]
def main():
start = time.time()
results = []
for rule in sys.argv[1:]:
for path in paths:
full_path = os.path.join(tests_folder, path)
result = make(full_path, rule)
make(full_path, 'clean')
results.append(result)
sys.stdout.write('.' if result[0] == 0 else 'F')
sys.stdout.flush()
rule = sys.argv[1]
paths = sys.argv[2:]
for path in paths:
result = make(path, rule)
make(path, 'clean')
results.append(result)
sys.stdout.write('.' if result[0] == 0 else 'F')
sys.stdout.flush()
sys.stdout.write('\n')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment