- suite="`basename "$file" .o | sed 's/\"/\\\\\"/g'`"
- echo -e '\tmutest_suite_name = "'"$suite"'";'
- echo -e '\tmu_print(MU_SUITE, "\\nRunning suite \"'"$suite"'\"\\n");'
- for symbol in `nm -p "$file" \
- | egrep '^[[:xdigit:]]{8} T mu_test\w*$' \
- | cut -c12-`
+ pr_file=`echo "$file" | sed 's/\"/\\\\\"/g'`
+ suite=`basename "$file" .o | sed 's/\"/\\\\\"/g'`
+ symbols=`nm "$file" | egrep '^[[:xdigit:]]+ T mu_\w+$' | cut -d' ' -f3`
+ tests=`echo "$symbols" | egrep '^mu_test'`
+ inits=`echo "$symbols" | egrep '^mu_init'`
+ terms=`echo "$symbols" | egrep '^mu_term'`
+ echo -e '\tdo {'
+ echo -e '\t\tmutest_suite_name = "'"$suite"'";'
+ echo -e '\t\tmu_print(MU_SUITE, "\\nRunning suite '"'$suite'"'\\n");'
+ for init in $inits
+ do
+ echo -e "\\t\\tmu_run_init($init);"
+ done
+ for testcase in $tests
+ do
+ echo -e "\t\tmu_run_case($testcase);"
+ done
+ for term in $terms