This commit is contained in:
blueloveTH 2023-02-10 23:49:23 +08:00
parent b5b9f59689
commit b7ca9dfa33
2 changed files with 16 additions and 15 deletions

View File

@ -13,8 +13,7 @@ jobs:
mv src/pocketpy.h src/pocketpy.cpp
CL -std:c++17 -GR- -EHsc -O2 -LD -Fe:pocketpy src/pocketpy.cpp
python3 scripts/run_tests.py
./pocketpy tests/t1.py
./pocketpy tests/t2.py
python3 scripts/run_tests.py benchmarks/
mkdir -p output/windows/x86_64
mv pocketpy.exe output/windows/x86_64
mv pocketpy.dll output/windows/x86_64
@ -55,8 +54,7 @@ jobs:
bash build_cpp.sh
bash build_linux.sh
python3 scripts/run_tests.py
./pocketpy tests/t1.py
./pocketpy tests/t2.py
python3 scripts/run_tests.py benchmarks/
mkdir -p output/linux/x86_64
mv pocketpy output/linux/x86_64
mv pocketpy.so output/linux/x86_64

View File

@ -10,19 +10,22 @@ def test_file(filepath):
def test_dir(path):
has_error = False
for filename in os.listdir(path):
if filename.endswith('.py'):
if(not filename.startswith('_')):
if not filename.endswith('.py'):
continue
filepath = os.path.join(path, filename)
print("> " + filepath)
code = test_file(filepath)
if not code:
print("[x] " + filepath)
has_error = True
else:
print("[v] " + filepath)
exit(1)
return not has_error
if __name__ == '__main__':
ok = test_dir('tests')
if len(sys.argv) > 1:
d = sys.argv[1]
else:
d = 'tests/'
print("Testing directory:", d)
ok = test_dir(d)
if ok:
print("ALL TESTS PASSED")