modules/test: allow arbitrary warning/assertion expecations

Allow defining expectation predicates that will be tested on the final
warnings/assertions lists.
This commit is contained in:
Matt Sturgeon 2024-12-27 13:46:29 +00:00
parent e7dcc9b518
commit c2e172b0d3
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
2 changed files with 166 additions and 20 deletions

View file

@ -38,7 +38,9 @@ linkFarmFromDrvs "failing-tests" [
}
''
[[ 1 = $(cat "$failed/testBuildFailure.exit") ]]
grep -F 'Unexpected warnings:' "$failed/testBuildFailure.log"
grep -F 'Failed 1 expectation' "$failed/testBuildFailure.log"
grep -F 'Expected length to be 0 but found 1.' "$failed/testBuildFailure.log"
grep -F 'For warnings' "$failed/testBuildFailure.log"
grep -F 'Hello, world!' "$failed/testBuildFailure.log"
touch $out
''
@ -59,7 +61,9 @@ linkFarmFromDrvs "failing-tests" [
}
''
[[ 1 = $(cat "$failed/testBuildFailure.exit") ]]
grep -F 'Unexpected assertions:' "$failed/testBuildFailure.log"
grep -F 'Failed 1 expectation' "$failed/testBuildFailure.log"
grep -F 'Expected length to be 0 but found 1.' "$failed/testBuildFailure.log"
grep -F 'For assertions' "$failed/testBuildFailure.log"
grep -F 'Hello, world!' "$failed/testBuildFailure.log"
touch $out
''