Wenzel Jakob | 38bd711 | 2015-07-05 20:05:44 +0200 | [diff] [blame] | 1 | import subprocess, sys, os |
2 | |||||
3 | path = os.path.dirname(__file__) | ||||
4 | if path != '': | ||||
5 | os.chdir(path) | ||||
6 | |||||
7 | name = sys.argv[1] | ||||
8 | output = subprocess.check_output([sys.executable, name + ".py"]).decode('utf-8') | ||||
9 | reference = open(name + '.ref', 'r').read() | ||||
10 | |||||
11 | if output == reference: | ||||
12 | print('Test "%s" succeeded.' % name) | ||||
13 | exit(0) | ||||
14 | else: | ||||
15 | print('Test "%s" FAILED!' % name) | ||||
16 | exit(-1) |