| 1 | #!/bin/sh |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | cp -a tests $AUTOPKGTEST_TMP |
| 6 | cd $AUTOPKGTEST_TMP/tests |
| 7 | |
| 8 | CFLAGS=$(pkg-config --cflags cpputest) |
| 9 | LDFLAGS=$(pkg-config --libs cpputest) |
| 10 | |
| 11 | build_and_run() { |
| 12 | for file in *.c; do |
| 13 | echo "Building $file" |
| 14 | gcc $CFLAGS -c $file -o ${file%%.c}.o |
| 15 | done |
| 16 | for file in *.cpp; do |
| 17 | echo "Building $file" |
| 18 | g++ $CFLAGS -c $file -o ${file%%.cpp}.o |
| 19 | done |
| 20 | echo "Building run-tests" |
| 21 | g++ -o run-tests *.o $LDFLAGS |
| 22 | echo "Running the tests" |
| 23 | ./run-tests |
| 24 | } |
| 25 | |
| 26 | echo "Testing CppUTest" |
| 27 | cd CppUTest |
| 28 | build_and_run |
| 29 | cd .. |
| 30 | |
| 31 | echo "Testing CppUTestExt" |
| 32 | cd CppUTestExt |
| 33 | build_and_run |