add unit tests to test action and separate unit_tests.sh from test_all.sh
All checks were successful
/ test (push) Successful in 43s
All checks were successful
/ test (push) Successful in 43s
This commit is contained in:
parent
dac2cbc20d
commit
bcf0978b68
3 changed files with 29 additions and 24 deletions
|
|
@ -21,3 +21,5 @@ jobs:
|
||||||
- name: Test Core
|
- name: Test Core
|
||||||
working-directory: ./core
|
working-directory: ./core
|
||||||
run: go test
|
run: go test
|
||||||
|
- name: Run Unit Tests
|
||||||
|
run: bash unit_tests.sh
|
||||||
|
|
|
||||||
25
test_all.sh
25
test_all.sh
|
|
@ -20,27 +20,4 @@ else
|
||||||
fi
|
fi
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
errors=()
|
bash ./unit_tests.sh
|
||||||
|
|
||||||
echo '=== Testing anglais ==='
|
|
||||||
|
|
||||||
# read files
|
|
||||||
for file in $(find tests -type f); do
|
|
||||||
echo "-v- Test-running file $file -v-"
|
|
||||||
|
|
||||||
if ! ./cli/cli run "$file"; then
|
|
||||||
echo "-x- Error -x-"
|
|
||||||
errors+=("$file")
|
|
||||||
else
|
|
||||||
echo "-+- Success -+-"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
if [ 0 -ne "$(wc -w <<< "${errors[@]}")" ]; then
|
|
||||||
echo "=x= Errors occured while executing =x="
|
|
||||||
echo "erroring files: $(printf '%s ' "${errors[@]}")"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo '=+= Successfully ran all tests =+='
|
|
||||||
fi
|
|
||||||
|
|
|
||||||
26
unit_tests.sh
Normal file
26
unit_tests.sh
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
errors=()
|
||||||
|
|
||||||
|
echo '=== Testing anglais ==='
|
||||||
|
|
||||||
|
# read files
|
||||||
|
for file in $(find tests -type f); do
|
||||||
|
echo "-v- Test-running file $file -v-"
|
||||||
|
|
||||||
|
if ! ./cli/cli run "$file"; then
|
||||||
|
echo "-x- Error -x-"
|
||||||
|
errors+=("$file")
|
||||||
|
else
|
||||||
|
echo "-+- Success -+-"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
if [ 0 -ne "$(wc -w <<< "${errors[@]}")" ]; then
|
||||||
|
echo "=x= Errors occured while executing =x="
|
||||||
|
echo "erroring files: $(printf '%s ' "${errors[@]}")"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo '=+= Successfully ran all tests =+='
|
||||||
|
fi
|
||||||
Loading…
Add table
Add a link
Reference in a new issue