summaryrefslogtreecommitdiff
path: root/TC/unit/tc_gen.sh
blob: 54f482d93467573a3e13d58d073a3b1c01a0fadc (plain)
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
#!/bin/sh

TMPSTR=$0
SCRIPT=${TMPSTR##*/}

if [ $# -lt 2 ]; then
	echo "Usage) $SCRIPT module_name api_name"
	exit 1
fi

MODULE=$1
API=$2
TEMPLATE=utc_MODULE_API_func.c.in
TESTCASE=utc_${MODULE}_${API}_func

sed -e	'
	s^@API@^'"$API"'^g
	s^@MODULE@^'"$MODULE"'^g
	' $TEMPLATE > $TESTCASE.c

if [ ! -e "$TESTCASE.c" ]; then
	echo "Failed"
	exit 1
fi
echo "Testcase file is $TESTCASE.c"
echo "Done"
echo "please put \"$TESTCASE\" as Target in Makefile"
echo "please put \"/unit/$TESTCASE\" in tslist"