1
#!/bin/sh
2
EXTRACT="`dirname $0`/extractmethodcalls.rb"
3
IGNORE="^\(streameventqueue\|abstractmediastream2\|lockfreequeue\|path\|platform\|iodevicestream\|medianode\|streaminterface\|mediasource\|abstractmediastream\|audioplayer\|globalconfig\|objectdescriptionmodel\|audiooutputadaptor\|effectwidget\|videoplayer\|seekslider\|volumeslider\).cpp$"
4
5
if test -n "$1" -a -f "$1"; then
6
	echo "preprocessing $1"
7
	cpp $1 2>/dev/null > tmp
8
	echo "extracting backend calls from $1"
9
	$EXTRACT tmp > tests/methods/$1
10
	rm tmp
11
else
12
	for i in *.cpp; do
13
		if echo $i | grep -q "$IGNORE"; then
14
			printf "%-30s ignored.\n" "$i:"
15
		elif echo $i | grep -q '_p\.cpp$'; then
16
			printf "%-30s postponed.\n" "$i:"
17
		else
18
			printf "%-30s preprocessing" "$i:"
19
			cpp $i 2>/dev/null > tmp
20
			echo -n ", extracting backend calls"
21
			$EXTRACT tmp > tests/methods/$i
22
			rm tmp
23
			echo "."
24
		fi
25
	done
26
	for i in *_p.cpp; do
27
		cpp=`echo $i | sed 's,_p\.cpp$,\.cpp,'`
28
		if echo $cpp | grep -q "$IGNORE"; then
29
			printf "%-30s ignored.\n" "$i:"
30
		elif test "$i" != "*_p.cpp"; then
31
			printf "%-30s preprocessing" "$i:"
32
			cpp $i 2>/dev/null > tmp
33
			echo -n ", extracting backend calls"
34
			$EXTRACT tmp >> tests/methods/$cpp
35
			rm tmp
36
			echo "."
37
		fi
38
	done
39
fi