* added scripts to run tests
authorUrban Wallasch <urban.wallasch@freenet.de>
Thu, 31 Oct 2019 18:09:50 +0000 (19:09 +0100)
committerUrban Wallasch <urban.wallasch@freenet.de>
Thu, 31 Oct 2019 18:09:50 +0000 (19:09 +0100)
net/run_test.sh [new file with mode: 0755]
run_tests.sh [new file with mode: 0755]
str/run_test.sh [new file with mode: 0755]
trace/run_test.sh [new file with mode: 0755]

diff --git a/net/run_test.sh b/net/run_test.sh
new file mode 100755 (executable)
index 0000000..50c9d79
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+EXEC=net_test
+SRC=*.c
+OPTS="-Wall -Wextra -Werror -O2"
+
+CMD="gcc $OPTS -o $EXEC $SRC"
+echo $CMD
+$CMD && ./$EXEC
diff --git a/run_tests.sh b/run_tests.sh
new file mode 100755 (executable)
index 0000000..d3701b8
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+DIR="$(dirname $(realpath "$0"))"
+cd "$DIR"
+
+TESTS=$(find . -type f -name 'run_test.sh')
+
+for T in $TESTS; do
+    cd $(dirname $T)
+    ./${T##*/}
+    echo -e "\nHit [ENTER] to continue ..."
+    read $junk
+    cd - > /dev/null
+done
+
diff --git a/str/run_test.sh b/str/run_test.sh
new file mode 100755 (executable)
index 0000000..737fbe9
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+EXEC=str_test
+SRC=*.c
+OPTS="-std=c99 -Wpedantic -Wall -Wextra -Werror -O2"
+
+CMD="gcc $OPTS -o $EXEC $SRC"
+echo $CMD
+$CMD && ./$EXEC
diff --git a/trace/run_test.sh b/trace/run_test.sh
new file mode 100755 (executable)
index 0000000..eb32b6c
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+EXEC=trace_test
+SRC=*.c
+OPTS="-std=c11 -Wpedantic -Wall -Wextra -Werror -O2 -DTRACE_ON"
+
+CMD="gcc $OPTS -o $EXEC $SRC"
+echo $CMD
+$CMD && ./$EXEC
+