This repository has been archived on 2026-05-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
piquant/tests/test.sh
2016-03-27 12:42:42 -07:00

21 lines
402 B
Bash

#!/bin/bash
for testfile in *.c
do
filebase=$(basename $testfile | sed 's/\.c$//')
compile_def=$(cat <<EOF
function shunittest_compile_${filebase} {
set -e ; make ${filebase}.elf >&2 ; test -e ${filebase}.elf ; set +e
}
EOF
)
eval "$compile_def"
run_def=$(cat <<EOF
function shunittest_run_${filebase} {
set -e ; ./${filebase}.elf >&2 ; set +e
}
EOF
)
eval "$run_def"
done