File: test-example-code

package info (click to toggle)
mstch 1.0.2-7
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 960 kB
  • sloc: cpp: 1,443; sh: 17; makefile: 4
file content (26 lines) | stat: -rwxr-xr-x 523 bytes parent folder | download
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
#!/bin/sh

set -e

# Switch to the test directory
cd $(dirname $0)

at_exit() {
    echo "info: test exiting"
}
trap at_exit INT TERM EXIT

PROG="$AUTOPKGTEST_TMP/test-example-code-program"
c++ -Wall -Werror test-example-code.cc  -lmstch -o "$PROG" 2>&1

if type valgrind > /dev/null 2>&1 ; then
    VALGRIND="valgrind"
fi

if $VALGRIND "$PROG" | diff - test-example-code-expected.out; then
  echo "success: program produced expected output"
else
  echo "failure: program did not produce expected output"
fi

rm -f "$PROG"