run_test.py 378 Bytes
Newer Older
Wenzel Jakob's avatar
Wenzel Jakob committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import subprocess, sys, os

path = os.path.dirname(__file__)
if path != '':
    os.chdir(path)

name = sys.argv[1]
output    = subprocess.check_output([sys.executable, name + ".py"]).decode('utf-8')
reference = open(name + '.ref', 'r').read()

if output == reference:
    print('Test "%s" succeeded.' % name)
    exit(0)
else:
    print('Test "%s" FAILED!' % name)
    exit(-1)