diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c8ab80..d409f27 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,5 +18,6 @@ jobs: run: | curl -sL https://git.io/fisher | source fisher install $GITHUB_WORKSPACE - fishtape tests/* + fishtape tests/invdalid.fish || true # should fail + fishtape (string match -v '*invalid*' -- tests/*) shell: fish {0} diff --git a/functions/fishtape.fish b/functions/fishtape.fish index 7759f92..b15c2fe 100644 --- a/functions/fishtape.fish +++ b/functions/fishtape.fish @@ -94,7 +94,8 @@ function fishtape --description "Test scripts, functions, and plugins in Fish" echo TAP version 13 for file in $files - fish --init-command=(functions @echo | string collect) --init-command=(functions @test | string collect) $file + fish --init-command=(functions @echo | string collect) --init-command=(functions @test | string collect) $file \ + || set _fishtape_test_failed (math $_fishtape_test_failed + 1) end echo diff --git a/tests/invalid.fish b/tests/invalid.fish new file mode 100644 index 0000000..d5a463e --- /dev/null +++ b/tests/invalid.fish @@ -0,0 +1,4 @@ +@echo === invalid === + +@test "a valid test but invalid file" true = true +end # we want to trigger a parsing error