Skip to content

Commit

Permalink
[test/spec] Assert number of C++ test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy C committed Nov 11, 2024
1 parent 155c411 commit 05713df
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
5 changes: 3 additions & 2 deletions spec/bugs.test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## compare_shells: bash dash mksh zsh ash
## oils_failures_allowed: 0
## oils_cpp_failures_allowed: 1
# TODO: fix C++ failure

# TODO: case #25 need this locally, but not in CI?
# oils_cpp_failures_allowed: 1

#### echo keyword
echo done
Expand Down
18 changes: 10 additions & 8 deletions test/sh_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -1445,12 +1445,18 @@ def _SuccessOrFailure(test_name, stats):
if oils_count != allowed:
errors.append('Got %d Oils failures, but %d are allowed' %
(oils_count, allowed))
else:
if allowed != 0:
log('%s: note: Got %d allowed Oils failures', test_name, allowed)

# TODO: remove special case for 0
if 0:
if oils_cpp_count != 0 and oils_cpp_count != allowed_cpp:
errors.append('Got %d Oils C++ failures, but %d are allowed' %
(oils_cpp_count, allowed))
if oils_cpp_count != 0 and oils_cpp_count != allowed_cpp:
errors.append('Got %d Oils C++ failures, but %d are allowed' %
(oils_cpp_count, allowed))
else:
if allowed_cpp != 0:
log('%s: note: Got %d allowed Oils C++ failures', test_name,
allowed_cpp)

if all_count != allowed:
errors.append('Got %d total failures, but %d are allowed' %
Expand All @@ -1461,10 +1467,6 @@ def _SuccessOrFailure(test_name, stats):
log('%s: FATAL: %s', test_name, msg)
return 1

if allowed != 0:
log('%s: note: Got %d allowed oils failures (exit with code 0)',
test_name, allowed)

return 0


Expand Down

0 comments on commit 05713df

Please sign in to comment.