-
Notifications
You must be signed in to change notification settings - Fork 0
/
guicat.sh
executable file
·94 lines (77 loc) · 2.72 KB
/
guicat.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
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
#!/usr/bin/env bash
if [ -z $1 ]; then
echo "Usage: ./guicat ./conf/ticket/ticket.conf"
exit
fi
#. ./conf/ticket/ticket.conf
. $1
#if [[ -z $3 ]]; then
# GUITAR_TC_LEN=$3
#fi
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
for jar in `ls $libDir`
do
if [[ $jar == *.jar ]]
then
classpath=$classpath":"$libDir"/"$jar
fi
done
#echo $libDir
#echo $classpath
rm -rf $AUTDIR branches/
mkdir -p $AUTDIR
mkdir -p branches/
mkdir -p $AUTDIR"/testcases"
./clean.sh
cmd="java -cp $classpath guicat.util.PrintAccessbileName $AUT_MAINCLASS"
eval $cmd > $AUTDIR"/accessbileName.txt"
ripperCmd="java -Dlog4j.configuration=$log4j -cp $classpath edu.umd.cs.guitar.ripper.JFCRipperMain -c $AUT_MAINCLASS -g $guiFile -cf $configurationFile -d 10 -i 200 -l $logFile"
echo $ripperCmd
eval $ripperCmd
#exit
gui2efgCmd="java -Dlog4j.configuration=$log4j -cp $classpath edu.umd.cs.guitar.graph.GUIStructure2GraphConverter -p EFGConverter -g $guiFile -e $efgFile"
eval $gui2efgCmd
#exit
testcaseCmd="java -Dlog4j.configuration=$logFile -cp $classpath edu.umd.cs.guitar.testcase.TestCaseGenerator -p SequenceLengthCoverage -e $efgFile -l $GUITAR_TC_LEN -m 20000 -d $AUTTESTCASE"
#testcaseCmd="java -Dlog4j.configuration=$logFile -cp $classpath edu.umd.cs.guitar.testcase.TestCaseGenerator -p RandomSequenceLengthCoverage -e $efgFile -l $GUITAR_TC_LEN -m 200 -d $AUTTESTCASE"
#testcaseCmd="java -Dlog4j.configuration=$log4j -cp $classpath edu.umd.cs.guitar.testcase.TestCaseGenerator -p BytecodeAnalysis -e $efgFile -l $GUITAR_TC_LEN -m 200 -d $AUTTESTCASE --scope $CLASSPATH --method pair --shared 0"
#echo $testcaseCmd
eval $testcaseCmd
#exit
#
#enumCmd="java -Dguicat.conf=$guicatConfigFile -cp $classpath guicat.testcase.EnumGenerator $AUTTESTCASE $enumGuicatTestcase $guiFile"
##echo $enumCmd
#eval $enumCmd
#
#
#for testcase in `find $enumGuicatTestcase -type f -name "*.tst" -printf '%f\n'`
#do
# testcase_id=${testcase%????}
# python concolic.py -Dguicat.conf=$guicatConfigFile 32 --autosym -t $testcase_id edu.umd.cs.guitar.replayer.JFCReplayerMain "-c $AUT_MAINCLASS -g $guiFile -e $efgFile -t $enumGuicatTestcase/$testcase_id.tst -i 200 -d 10 -l $AUTDIR/logs/$testcase_id.log -gs $AUTDIR/states/$testcase_id.sta -cf $configurationFile -ts"
##break
#done
#
#mv branches $AUTDIR
#
##create guicat testcases
#cmd="java -Dguicat.conf=$guicatConfigFile -cp $classpath guicat.testcase.Generator $guiFile $enumGuicatTestcase $branchDir $autGuicatTestcase"
##echo $cmd
#eval $cmd
#
./jacoco.sh $AUT guitar
./jacoco.sh $AUT guicat
./save-data.sh $1 $2