forked from extern/nushell
catch any test error and throw an error
this allows the test runner to stop whenever there is a failing test and throw an `$env.LAST_EXIT_CODE` to `1`.
This commit is contained in:
parent
64f50a179e
commit
ec85b6fd3f
@ -15,7 +15,14 @@ def main [] {
|
|||||||
|
|
||||||
for test_case in $tests {
|
for test_case in $tests {
|
||||||
log debug $"Run test ($module_name) ($test_case)"
|
log debug $"Run test ($module_name) ($test_case)"
|
||||||
|
try {
|
||||||
nu -c $'use ($test_file) ($test_case); ($test_case)'
|
nu -c $'use ($test_file) ($test_case); ($test_case)'
|
||||||
|
} catch { error make {
|
||||||
|
msg: $"(ansi red)std::tests::test_failed(ansi reset)"
|
||||||
|
label: {
|
||||||
|
text: $"($module_name)::($test_case) failed."
|
||||||
|
}
|
||||||
|
}}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user