-
Notifications
You must be signed in to change notification settings - Fork 0
/
jgp.sh
executable file
·56 lines (45 loc) · 1.83 KB
/
jgp.sh
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
AUT="jgp"
AUTDIR="log/"$AUT
AUTTESTCASE=$AUTDIR"/testcases"
configurationFile="./conf/jgp/configuration.xml"
AUT_MAINCLASS="jgp.gui.JGP"
guiFile=$AUTDIR"/"$AUT".GUI"
efgFile=$AUTDIR"/"$AUT".EFG"
logFile=$AUTDIR"/"$AUT".log"
classpath="."
for jar in `ls lib`
do
if [[ $jar == *.jar ]]
then
classpath=$classpath":./lib/"$jar
fi
done
for jar in `ls aut`
do
if [[ $jar == *.jar ]]
then
classpath=$classpath":./aut/"$jar
fi
done
classpath=$classpath":./aut/jgp/classes"
rm inputs* branches/
rm -rf $AUTDIR branches/
mkdir $AUTDIR
mkdir branches/
touch inputs
mkdir $AUTDIR"/testcases"
ripperCmd="java -Dlog4j.configuration=$logFile -cp $classpath edu.umd.cs.guitar.ripper.JFCRipperMain -c $AUT_MAINCLASS -g $guiFile -cf $configurationFile -d 500 -i 2000 -l $logFile"
eval $ripperCmd
gui2efgCmd="java -Dlog4j.configuration=$logFile -cp $classpath edu.umd.cs.guitar.graph.GUIStructure2GraphConverter -p EFGConverter -g $guiFile -e $efgFile"
eval $gui2efgCmd
#testcaseCmd="java -Dlog4j.configuration=$logFile -cp $classpath edu.umd.cs.guitar.testcase.TestCaseGenerator -p RandomSequenceLengthCoverage -e $efgFile -l 1 -m 200 -d $AUTTESTCASE"
testcaseCmd="java -Dlog4j.configuration=$logFile -cp $classpath edu.umd.cs.guitar.testcase.TestCaseGenerator -p BytecodeAnalysis -e $efgFile -l 1 -m 200 -d $AUTTESTCASE --scope ./aut/radioButton.jar --method pair --shared 0"
echo $testcaseCmd
eval $testcaseCmd
for testcase in `find $AUTTESTCASE -type f -name "*.tst" -printf '%f\n'`
do
testcase_id=${testcase%????}
python concolic.py -v 32 -t $testcase_id edu.umd.cs.guitar.replayer.JFCReplayerMain "-c $AUT_MAINCLASS -g $guiFile -e $efgFile -t $AUTDIR/testcases/$testcase_id.tst -i 2000 -d 200 -l $AUTDIR/logs/$testcase_id.log -gs $AUTDIR/states/$testcase_id.sta -cf $configurationFile -ts"
#break
done
mv branches $AUTDIR