scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit 1915e51243e12bb5a4037d8458d53c0cc32f160e
parent 8602956fac4b220603a14c18fb9f9adfff9044bb
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 12 Dec 2016 09:27:29 +0100

[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.

Diffstat:
Atests/compose.sh | 23+++++++++++++++++++++++
1 file changed, 23 insertions(+), 0 deletions(-)

diff --git a/tests/compose.sh b/tests/compose.sh @@ -0,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 +