#!/bin/sh
cat <<EOF
#include <iostream>
#include <j/cppunit/cppunit.hpp>
EOF
# include test case files
TEST_CASE_FILES=`ls -1 src/ut_*.cpp | sed -e "s/src\///"`
for f in ${TEST_CASE_FILES}; do
echo "#include \"${f}\""
done
cat <<EOF
using namespace j;
using namespace j::cppunit;
int main()
{
EOF
# test suite
TEST_CASE_CLASSES=`grep "class.*TestCase" src/* | sed -e "s/.*class\s\+\([A-Za-z0-9_]\+\)\s\+\:\s\+public\s\+TestCase/\1/"`
for cls in ${TEST_CASE_CLASSES}; do
echo "\t{ ${cls} tc; tc.suite(); }"
done
cat <<EOF
testManager.printResult();
return 0;
}
EOF