ref: 9c95b77e8f083c0d62348f292890e8c261a2580a
parent: f607d70ced972b116e87b76c266b18aacdeb1951
author: Roberto E. Vargas Caballero <[email protected]>
date: Mon Dec 12 04:27:29 EST 2016
[tests] Add compose.sh This script creates a program compossed of all the tests and can be used to test the code coverage of the tests.
--- /dev/null
+++ b/tests/compose.sh
@@ -1,0 +1,23 @@
+#!/bin/sh
+
+rm -f tmp_test.c
+rm -f tests.h
+rm -f tmp_*.c
+
+(echo '#include "tests.h"'
+echo 'int main()'
+echo '{'
+
+for i in *-*.c
+do
+ n=`echo $i | sed 's/\(.*\)-.*\.c/\1/'`
+ sed s/main/main_$n/ < $i > tmp_$n.c
+ echo "int main_$n();" >> tests.h
+ echo "main_$n();"
+
+done
+
+echo 'return 0;'
+echo '}'
+) > tmp_test.c
+