improve test/makemain.sh, move queu_pop code to vector class
[cgds.git] / test / makeMain.sh
CommitLineData
a7868768
BA
1#/bin/bash
2#TODO: dispatch in several files and run in parallel ?!
3
4#initialize main.c
5printf '#include <stdlib.h>\n' > main.c
6printf '\n' >> main.c
7printf 'int main(int argc, char** argv)\n' >> main.c
8printf '{\n' >> main.c
9
10#add functions
11for file in `find . -type f -name \*.c ! -name main.c`; do
12 printf "\t//file $file :\n" >> main.c
8306616e 13 functions=`grep '^ *void t_' $file | sed 's/^ *\(void [^(]*\).*/\t\1();/g'`
a7868768 14 printf "$functions" >> main.c
8306616e 15 printf '\n\n' >> main.c
a7868768
BA
16done
17
18#finalize main.c
8306616e 19printf '\treturn 0;\n' >> main.c
a7868768 20printf '}\n' >> main.c