based tests

This commit is contained in:
Roman Volovoy
2026-06-03 17:04:29 +02:00
parent 2d1c312421
commit 992287bc1f

28
aliases
View File

@@ -20,7 +20,7 @@ cc-run(){
cc-clean
}
cc-run-test(){
cc-run-test-inline(){
local file
if [ -z "$1" ]; then
echo "Usage: cc-run <file> [args...]" >&2
@@ -43,6 +43,32 @@ cc-run-test(){
cc-clean
}
cc-run-test(){
local file
if [ -z "$1" ]; then
echo "Usage: cc-run <file> [args...]" >&2
return 1
fi
cc-clean
file="$1"
shift
# remove trailing .c if present
base="${file%.*}"
if command -v norminette &>/dev/null; then
norminette "${base}.c"
fi
# compile base.test.c -> base.test.out and run it
cc -std=c99 "${base}.test.c" -o "${base}.test.out" -Wall -Wextra -Werror &&
"./${base}.test.out" "$@"
cc-clean
}
cc-run-lax(){
local file