Skip to content

Commit

Permalink
Fix test runner scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Jul 30, 2024
1 parent 56d0505 commit fba039d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/c.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ jobs:

- name: Run tests (ubuntu lts)
if: ${{ contains(matrix.os, 'ubuntu') && matrix.os != 'ubuntu-latest' }}
run: make c_test_auto COV=true
run: make c_test_auto

- name: Run tests (windows)
if: ${{ contains(matrix.os, 'windows') }}
run: make c_test_auto COV=true
run: make c_test_auto

- name: Run tests (macos)
if: ${{ contains(matrix.os, 'macos') }}
run: make c_test_auto COV=true
run: make c_test_auto
env:
NO_OPTIONAL_TESTS: true
COMPILER_OVERRIDE: clang
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cplusplus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ jobs:

- name: Run tests (ubuntu lts)
if: ${{ contains(matrix.os, 'ubuntu') && matrix.os != 'ubuntu-latest' }}
run: make c_test_auto COV=true
run: make c_test_auto

- name: Run tests (windows)
if: ${{ contains(matrix.os, 'windows') }}
run: make cp_test_auto COV=true
run: make cp_test_auto

- name: Run tests (macos)
if: ${{ contains(matrix.os, 'macos') }}
run: make cp_test_auto COV=true
run: make cp_test_auto
env:
NO_OPTIONAL_TESTS: true
COMPILER_OVERRIDE: clang
Expand Down
5 changes: 4 additions & 1 deletion c/test_euler.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,10 @@ def test_problem(benchmark, key, compiler):
answer = benchmark.pedantic(run_test, iterations=1, rounds=1)
else:
answer = benchmark(run_test)
assert answers[key] == int(answer.strip())
if isinstance(answers[key], int):
assert answers[key] == int(answer.strip())
else:
assert answers[key] == answer.strip()
# sometimes benchmark disables itself, so check for .stats
if 'PYTEST_XDIST_WORKER' not in environ and hasattr(benchmark, 'stats') and benchmark.stats.stats.median > 60:
fail_func = xfail if key in known_slow else fail
Expand Down
5 changes: 4 additions & 1 deletion cplusplus/test_euler.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,10 @@ def test_problem(benchmark, key, compiler):
answer = benchmark.pedantic(run_test, iterations=1, rounds=1)
else:
answer = benchmark(run_test)
assert answers[key] == int(answer.strip())
if isinstance(answers[key], int):
assert answers[key] == int(answer.strip())
else:
assert answers[key] == answer.strip()
# sometimes benchmark disables itself, so check for .stats
if 'PYTEST_XDIST_WORKER' not in environ and hasattr(benchmark, 'stats') and benchmark.stats.stats.median > 60:
fail_func = xfail if key in known_slow else fail
Expand Down

0 comments on commit fba039d

Please sign in to comment.