Compare commits

...

4 Commits

Author SHA1 Message Date
29db93f9fe feat (make): add targets for tests 2022-08-21 18:51:10 +05:30
804efb6b39 patch (tests): oops missed a ref
tbf i didn't check anything and yolo'd it
...so definitely not unexpected
2022-08-21 18:50:02 +05:30
639a8847e7 patch (tests): update output path for tests
variables. who knew they would be so handy?
2022-08-21 18:39:39 +05:30
a592500040 fix (tests): idk some minor return statement thing 2022-08-21 18:34:01 +05:30
3 changed files with 12 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
.PHONY: all builddir configure compile clean .PHONY: all builddir configure compile clean test
build: prebuild configure compile build: prebuild configure compile
INSTALL = install INSTALL = install
@@ -36,3 +36,8 @@ install: preinstall
uninstall: uninstall:
rm ${bindir}${BIN} rm ${bindir}${BIN}
rm ${mandir}${MAN} rm ${mandir}${MAN}
test:
test/default.sh
test-run:
test/stdouterr

4
test/.gitignore vendored
View File

@@ -1,2 +1,2 @@
test-output /output
stdouterr /stdouterr

View File

@@ -19,8 +19,8 @@ curr_hash=$(get_last_commit)
script_dir="$(realpath -e $(dirname "${0}") 2>/dev/null)" script_dir="$(realpath -e $(dirname "${0}") 2>/dev/null)"
project_root=${script_dir%/*} # remove everything after the final `/` project_root=${script_dir%/*} # remove everything after the final `/`
test_dir="${project_root}/dev/tests.d" test_dir="${project_root}/test"
out_dir="${project_root}/dev/test-output" out_dir="${test_dir}/output"
[[ ! -d "${out_dir}" ]] && mkdir -p "${out_dir}" [[ ! -d "${out_dir}" ]] && mkdir -p "${out_dir}"
src_dir="${project_root}/src" src_dir="${project_root}/src"
@@ -107,14 +107,14 @@ test(){
echo echo
echo echo
echo "=== end of test ===" echo "=== end of test ==="
return ret return ${ret}
} }
if check_compilers; then if check_compilers; then
if compile; then if compile; then
if test "$@"; then if test "$@"; then
echo "completed with exit code $?" echo "completed with exit code $?"
ln -sfn "${oname}" "${project_root}/dev/stdouterr" ln -sfn "${oname}" "${test_dir}/stdouterr"
fi fi
fi fi
else else