mirror of
https://github.com/pnx/neotest-phpunit
synced 2026-06-16 03:54:55 +02:00
Add test script
This commit is contained in:
parent
0e7e90334f
commit
6e04f7b2e7
1 changed files with 20 additions and 0 deletions
20
scripts/test
Executable file
20
scripts/test
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
tempfile=".test_output.tmp"
|
||||
|
||||
if [[ -n $1 ]]; then
|
||||
nvim --headless --noplugin -u specs/init.vim -c "PlenaryBustedFile $1" | tee "${tempfile}"
|
||||
else
|
||||
nvim --headless --noplugin -u specs/init.vim -c "PlenaryBustedDirectory specs/ {minimal_init = 'specs/init.vim'}" | tee "${tempfile}"
|
||||
fi
|
||||
|
||||
# Plenary doesn't emit exit code 1 when tests have errors during setup
|
||||
errors=$(sed 's/\x1b\[[0-9;]*m//g' "${tempfile}" | awk '/(Errors|Failed) :/ {print $3}' | grep -v '0')
|
||||
|
||||
rm "${tempfile}"
|
||||
|
||||
if [[ -n $errors ]]; then
|
||||
echo "Tests failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue