File: build-and-run-upstream-testsuite

package info (click to toggle)
cpputest 4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 6,632 kB
  • sloc: cpp: 31,212; sh: 4,978; ansic: 1,360; makefile: 777; ruby: 676; xml: 8; sed: 1
file content (33 lines) | stat: -rwxr-xr-x 590 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh

set -e

cp -a tests $AUTOPKGTEST_TMP
cd $AUTOPKGTEST_TMP/tests

CFLAGS=$(pkg-config --cflags cpputest)
LDFLAGS=$(pkg-config --libs cpputest)

build_and_run() {
    for file in *.c; do
	echo "Building $file"
	gcc $CFLAGS -c $file -o ${file%%.c}.o
    done
    for file in *.cpp; do
	echo "Building $file"
	g++ $CFLAGS -c $file -o ${file%%.cpp}.o
    done
    echo "Building run-tests"
    g++ -o run-tests *.o $LDFLAGS
    echo "Running the tests"
    ./run-tests
}

echo "Testing CppUTest"
cd CppUTest
build_and_run
cd ..

echo "Testing CppUTestExt"
cd CppUTestExt
build_and_run