Update main.yml

Update main.yml

up

Update main.yml

update

Update main.yml

up

Update 04_str.py

Update run_tests.sh
This commit is contained in:
blueloveTH 2023-03-17 03:07:19 +08:00
parent c39fa047fe
commit 7a07eefed0
6 changed files with 31 additions and 11 deletions

View File

@ -58,9 +58,19 @@ jobs:
with:
version: 15
platform: x64
- name: Install Dependencies
run: |
sudo apt install -y libc++-15-dev libc++1-15 libc++abi-15-dev libc++abi1-15 libclang-rt-15-dev
- name: Coverage Test
run: |
python3 preprocess.py
bash run_tests.sh
- uses: actions/upload-artifact@v3
with:
name: coverage
path: .coverage
- name: Compiling
run: |
sudo apt install -y libc++-15-dev libc++1-15 libc++abi-15-dev libc++abi1-15
python3 build.py linux
python3 build.py linux -lib
python3 scripts/run_tests.py

1
.gitignore vendored
View File

@ -3,6 +3,7 @@ __pycache__/
.ipynb_checkpoints
.DS_Store
.hidden
.coverage
src/main
gmon.out

View File

@ -1,6 +0,0 @@
clang++ -std=c++17 -fno-rtti --coverage -Wall -o pocketpy src/main.cpp
python3 scripts/run_tests.py
llvm-cov-15 gcov main.gc -r -s src/
rm -rf .coverage
mkdir -p .coverage
mv *.gcov .coverage

10
run_tests.sh Normal file
View File

@ -0,0 +1,10 @@
clang++ -std=c++17 -fno-rtti --coverage -stdlib=libc++ -Wall -o pocketpy src/main.cpp
python3 scripts/run_tests.py
rm -rf .coverage
mkdir -p .coverage
llvm-cov-15 gcov main.gc -r -s src/ >> .coverage/coverage.txt
mv *.gcov .coverage
rm main.gc*
# -fprofile-instr-generate -fcoverage-mapping
# llvm-cov-15 show main.gc -instr-profile=default.profraw -format=html -output-dir .coverage

View File

@ -12,7 +12,7 @@ def test_file(filepath, cpython=False):
def test_dir(path):
print("Testing directory:", path)
for filename in os.listdir(path):
for filename in sorted(os.listdir(path)):
if not filename.endswith('.py'):
continue
filepath = os.path.join(path, filename)

View File

@ -71,3 +71,8 @@ assert '|'.join(f()) == '0|1|2|3|4'
num = 6
assert str(num) == '6'
# test Lo group names
测试 = "test"
assert 测试 == "test"