pocketpy/scripts/run_tests.py
blueloveTH 0891000a46 init
2022-11-06 12:16:57 +08:00

23 lines
627 B
Python

import os
singletypepath = 'tests/singletype'
mixedtypepath = 'tests/mixedtype'
def test_file(filepath):
return os.system("./pocketpy " + filepath) == 0
#return os.system("python3 " + filepath) == 0
def test_dir(path):
print("=" * 50)
for filename in os.listdir(path):
if filename.endswith('.py'):
filepath = os.path.join(path, filename)
code = test_file(filepath)
if not code:
print("[x] " + filepath)
else:
print("[√] " + filepath)
if __name__ == '__main__':
test_dir(singletypepath)
test_dir(mixedtypepath)