-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestgenifx
executable file
·96 lines (77 loc) · 1.88 KB
/
testgenifx
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/sh
clear
echo "_________________________________________________________________"
echo " TestGen-IFx Tool."
echo "_________________________________________________________________"
echo
if [ x${IF:-} = x ]; then
echo "Please install IF correctly, and set the $IF environment variable"
exit 1
fi
if [ x${TestGenIFx:-} = x ]; then
echo "Please install TestGen-IFx correctly, and set the \$TestGenIFx environment variable"
exit 1
fi
if [ x${XERCESLIB:-} = x ]; then
echo "Please set the XERCESLIB environment variable to point to your Xerces library directory (binary)"
exit 1
fi
#
# Usage
#
if [ $# -ne 8 ]; then
echo "Usage: testgenifx -i input -s strategy -d maxdepth -t testpurpose"
exit 1
fi
#TestGenIFx="/Users/nhnghia/SudParis/workspace/TestGen-IFx"
SRC=${TestGenIFx}/src
LIB="${TestGenIFx}/lib"
#parser parameters
while getopts "i:d:s:o:c:p:t:" option;
do
case $option in
i)
spec_file="$OPTARG";;
d)
maxdepth="$OPTARG";;
s)
strategy="$OPTARG";;
t)
suite="$OPTARG";;
p)
projection="true";;
esac
done
#get "obu" from "obu.if"
spec_file=`basename $spec_file .if`
output="./$spec_file"
echo " Clean the output folder: $output"
rm -Rf $output >> /dev/null
mkdir -p $output >> /dev/null
CWD=$(pwd)
echo " Compiling test case: $suite ..."
cp "$suite" "$SRC/test_purpose.C"
cd $SRC
make tp >> /dev/null
if [ $? = 0 ]; then
echo " done"
else
cd $CWD
exit 1
fi
make install >> /dev/null
#return to the current folder
cd $CWD
#
echo " Compiling $spec_file.if file ..."
make -f $LIB/Makefile "$spec_file.g" >> /dev//null
if [ $? = 0 ]; then
echo " done"
else
rm "$spec_file.h"
exit 1
fi
./$spec_file.g -$strategy -d $maxdepth -o $output -sp
#-sp : project global test cases to local ones
rm $spec_file.g $spec_file.h >> /dev/null
echo "_________________________________________________________________"