Adding new test harness
[platform/core/uifw/dali-toolkit.git] / automated-tests / TET / dali-test-suite / tc-gen.sh
1 #!/bin/sh
2
3 TMPSTR=$0
4 SCRIPT=${TMPSTR##*/}
5
6 if [ $# -ne 1 ]; then
7         echo "Usage) $SCRIPT ClassName"
8         exit 1
9 fi
10
11 MODULE="Dali"
12 SECTION=${PWD##*/}
13 CLASS=$1
14
15 TESTSUITEPATH=`dirname $PWD`
16 TESTSUITENAME=${TESTSUITEPATH##*/}
17
18 TEMPLATE=../utc-MODULE-CLASS.cpp.in
19 TESTCASE=utc-${MODULE}-${CLASS}
20
21 # Create .cpp file
22 if [ ! -e "$TESTCASE.cpp" ]; then
23         sed -e  '
24                 s^@CLASS@^'"$CLASS"'^g
25                 s^@MODULE@^'"$MODULE"'^g
26                 ' $TEMPLATE > $TESTCASE.cpp
27 fi
28
29 if [ ! -e "$TESTCASE.cpp" ]; then
30         echo "Failed"
31         exit 1
32 fi
33
34
35 # file.list
36 if ! [ -f file.list ]; then
37         touch file.list
38         echo "TARGETS += \\" >> file.list
39 fi
40 echo "        $TESTCASE \\" >> file.list
41
42 # tslist
43 if ! [ -f tslist ]; then
44         touch tslist
45 fi
46 echo "/$TESTSUITENAME/$SECTION/$TESTCASE" >> tslist
47
48 # Makefile
49 if ! [ -f Makefile ]; then
50         ln -s ../master-makefile.mk Makefile
51 fi
52
53 echo "$TESTCASE" >> .gitignore
54
55 echo "Testcase file is $TESTCASE.cpp"
56 echo "$TESTCASE is added to tslist"
57 echo "$TESTCASE is added to file.list"
58 echo "Done"