Skip to content

Commit ba79ccc

Browse files
authored
Test failure and throwing (#14)
1 parent 1b5fdc5 commit ba79ccc

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

test/runtests.jl

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using ParallelTestRunner
2+
using Test
23

34
pushfirst!(ARGS, "--verbose")
45

@@ -24,7 +25,7 @@ runtests(ARGS; init_code, custom_tests)
2425
# custom worker
2526
function test_worker(name)
2627
if name == "needs env var"
27-
return addworker(env=["SPECIAL_ENV_VAR"=>"42"])
28+
return addworker(env = ["SPECIAL_ENV_VAR" => "42"])
2829
end
2930
return nothing
3031
end
@@ -37,3 +38,19 @@ custom_tests = Dict(
3738
end
3839
)
3940
runtests(ARGS; test_worker, custom_tests)
41+
42+
# failing test
43+
custom_tests = Dict(
44+
"failing test" => quote
45+
@test 1 == 2
46+
end
47+
)
48+
@test_throws Test.FallbackTestSetException("Test run finished with errors") runtests(ARGS; custom_tests)
49+
50+
# throwing test
51+
custom_tests = Dict(
52+
"throwing test" => quote
53+
error("This test throws an error")
54+
end
55+
)
56+
@test_throws Test.FallbackTestSetException("Test run finished with errors") runtests(ARGS; custom_tests)

0 commit comments

Comments
 (0)