mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
up
This commit is contained in:
parent
b5b9f59689
commit
b7ca9dfa33
6
.github/workflows/main.yml
vendored
6
.github/workflows/main.yml
vendored
@ -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
|
||||
|
@ -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('_')):
|
||||
continue
|
||||
filepath = os.path.join(path, filename)
|
||||
code = test_file(filepath)
|
||||
if not code:
|
||||
print("[x] " + filepath)
|
||||
has_error = True
|
||||
else:
|
||||
print("[v] " + filepath)
|
||||
if not filename.endswith('.py'):
|
||||
continue
|
||||
filepath = os.path.join(path, filename)
|
||||
print("> " + filepath)
|
||||
code = test_file(filepath)
|
||||
if not code:
|
||||
has_error = True
|
||||
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")
|
Loading…
x
Reference in New Issue
Block a user