File: dotest.sh

package info (click to toggle)
cmtk 3.2.2-1.3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 10,428 kB
  • ctags: 11,670
  • sloc: cpp: 86,941; ansic: 23,347; sh: 3,896; xml: 1,551; perl: 700; makefile: 344
file content (47 lines) | stat: -rwxr-xr-x 866 bytes parent folder | download | duplicates (17)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
(cd ..; make mxmldoc-static)

files=""
mode=""

while test $# -gt 0; do
	arg="$1"
	shift

	case "$arg" in
		-f) framed="--framed framed" ;;
		-g) mode="gdb" ;;
		-v) mode="valgrind" ;;
		*.h | *.c | *.cxx) files="$files $arg" ;;
		*)
			echo "Usage: ./dotest.sh [-f] [-g] [-v] [files]"
			exit 1
			;;
	esac
done

if test "$files" = ""; then
	files=*.cxx
fi

rm -f test.xml

case "$mode" in
	gdb)
		echo "break malloc_error_break" >.gdbcmds
		echo "set env DYLD_INSERT_LIBRARIES /usr/lib/libgmalloc.dylib" >>.gdbcmds
		echo "run $framed test.xml $files >test.html 2>test.log" >>.gdbcmds
		gdb -x .gdbcmds ../mxmldoc-static
		;;

	valgrind)
		valgrind --log-fd=3 --leak-check=yes \
			../mxmldoc-static $framed test.xml $files \
			>test.html 2>test.log 3>test.valgrind
		;;

	*)
		../mxmldoc-static $framed test.xml $files >test.html 2>test.log
		;;
esac