Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions build_submodules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
#"""
set -euo pipefail

function log()
{
function log() {
echo "[MetaCG] $1"
}

function err_exit()
{
function err_exit() {
echo "[MetaCG] Error: $1" >&2
exit 1
}
Expand Down
1 change: 0 additions & 1 deletion cgcollector/formatAllSrc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ find ./tools -iname "*.h" -not -type d -exec clang-format -i {} \;
find ./tools -iname "*.cpp" -not -type d -exec clang-format -i {} \;
find ./test -iname "*.h" -not -type d -exec clang-format -i {} \;
find ./test -iname "*.cpp" -not -type d -exec clang-format -i {} \;

7 changes: 3 additions & 4 deletions cgcollector/test/integration/cgvalidate/base.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
function report {
echo -e "\n[ --------------------------------- ] \n" >> "$logFile"
echo -e "\n[ --------------------------------- ] \n" >>"$logFile"
echo "Running cgvalidate Integration Test $testNo | $failStr"
}

function failed {
fails=$(($fails+1))
fails=$(($fails + 1))
failStr=FAIL
report
}
Expand All @@ -20,6 +20,5 @@ function checkErrorCode {
else
passed
fi
testNo=$(($testNo+1))
testNo=$(($testNo + 1))
}

87 changes: 42 additions & 45 deletions cgcollector/test/integration/cgvalidate/cgvalidate-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,24 @@
build_dir=build # may be changed with opt 'b'
while getopts ":b:h" opt; do
case $opt in
b)
if [ -z $OPTARG ]; then
echo "no build directory given, assuming \"build\""
fi
build_dir=$OPTARG
;;
h)
echo "use -b to provide a build directory NAME"
echo "use -h to print this help"
exit 0
;;
\?)
echo "Invalid option -$OPTARG"
exit 1
;;
b)
if [ -z $OPTARG ]; then
echo "no build directory given, assuming \"build\""
fi
build_dir=$OPTARG
;;
h)
echo "use -b to provide a build directory NAME"
echo "use -h to print this help"
exit 0
;;
\?)
echo "Invalid option -$OPTARG"
exit 1
;;
esac
done


fails=0
testNo=0
logDir=$PWD/logging
Expand All @@ -36,64 +35,62 @@ executable=$buildDir/cgvalidate
if [ ! -d ${logDir} ]; then
mkdir ${logDir}
fi
echo "" > ${logFile}
echo "" >${logFile}

# check if cgvalidate is available
if ! type $executable > /dev/null; then
if ! type $executable >/dev/null; then
failed
exit 1
else
passed
testNo=$(($testNo+1))
testNo=$(($testNo + 1))
fi

#general
## wrong input files
echo "Invocation: $executable -i $inputDir/general/0001.cubex -c $inputDir/general/0001.cubex" >> $logFile
$executable -i $inputDir/general/0001.cubex -c $inputDir/general/0001.cubex >> $logFile 2>&1
echo "Invocation: $executable -i $inputDir/general/0001.cubex -c $inputDir/general/0001.cubex" >>$logFile
$executable -i $inputDir/general/0001.cubex -c $inputDir/general/0001.cubex >>$logFile 2>&1
checkErrorCode 2
echo "Invocation: $executable -i $inputDir/general/0001.ipcg -c $inputDir/general/0001.ipcg" >> $logFile
$executable -i $inputDir/general/0001.ipcg -c $inputDir/general/0001.ipcg >> $logFile 2>&1
echo "Invocation: $executable -i $inputDir/general/0001.ipcg -c $inputDir/general/0001.ipcg" >>$logFile
$executable -i $inputDir/general/0001.ipcg -c $inputDir/general/0001.ipcg >>$logFile 2>&1
checkErrorCode 3

## missing edges
echo "Invocation: $executable -i $inputDir/general/0001_missedcallee.ipcg -c $inputDir/general/0001.cubex" >> $logFile
$executable -i $inputDir/general/0001_missedcallee.ipcg -c $inputDir/general/0001.cubex >> $logFile 2>&1
echo "Invocation: $executable -i $inputDir/general/0001_missedcallee.ipcg -c $inputDir/general/0001.cubex" >>$logFile
$executable -i $inputDir/general/0001_missedcallee.ipcg -c $inputDir/general/0001.cubex >>$logFile 2>&1
checkErrorCode 1
echo "Invocation: $executable -i $inputDir/general/0001_missedparent.ipcg -c $inputDir/general/0001.cubex" >> $logFile
$executable -i $inputDir/general/0001_missedparent.ipcg -c $inputDir/general/0001.cubex >> $logFile 2>&1
echo "Invocation: $executable -i $inputDir/general/0001_missedparent.ipcg -c $inputDir/general/0001.cubex" >>$logFile
$executable -i $inputDir/general/0001_missedparent.ipcg -c $inputDir/general/0001.cubex >>$logFile 2>&1
checkErrorCode 1
echo "Invocation: $executable -i $inputDir/general/0001_missedboth.ipcg -c $inputDir/general/0001.cubex" >> $logFile
$executable -i $inputDir/general/0001_missedboth.ipcg -c $inputDir/general/0001.cubex >> $logFile 2>&1
echo "Invocation: $executable -i $inputDir/general/0001_missedboth.ipcg -c $inputDir/general/0001.cubex" >>$logFile
$executable -i $inputDir/general/0001_missedboth.ipcg -c $inputDir/general/0001.cubex >>$logFile 2>&1
checkErrorCode 1

## successfull run
echo "Invocation $executable -i $inputDir/general/0001.ipcg -c $inputDir/general/0001.cubex" >> $logFile
$executable -i $inputDir/general/0001.ipcg -c $inputDir/general/0001.cubex >> $logFile 2>&1
echo "Invocation $executable -i $inputDir/general/0001.ipcg -c $inputDir/general/0001.cubex" >>$logFile
$executable -i $inputDir/general/0001.ipcg -c $inputDir/general/0001.cubex >>$logFile 2>&1
checkErrorCode 0

#virtual
echo "Invocation: $executable -i $inputDir/virtual/exp1.ipcg -c $inputDir/virtual/exp1.cubex" >> $logFile
$executable -i $inputDir/virtual/exp1.ipcg -c $inputDir/virtual/exp1.cubex >> $logFile 2>&1
echo "Invocation: $executable -i $inputDir/virtual/exp1.ipcg -c $inputDir/virtual/exp1.cubex" >>$logFile
$executable -i $inputDir/virtual/exp1.ipcg -c $inputDir/virtual/exp1.cubex >>$logFile 2>&1
checkErrorCode 0
echo "Invocation: $executable -i $inputDir/virtual/exp2.ipcg -c $inputDir/virtual/exp2.cubex" >> $logFile
$executable -i $inputDir/virtual/exp2.ipcg -c $inputDir/virtual/exp2.cubex >> $logFile 2>&1
echo "Invocation: $executable -i $inputDir/virtual/exp2.ipcg -c $inputDir/virtual/exp2.cubex" >>$logFile
$executable -i $inputDir/virtual/exp2.ipcg -c $inputDir/virtual/exp2.cubex >>$logFile 2>&1
checkErrorCode 0
echo "Invocation: $executable -i $inputDir/virtual/exp3.ipcg -c $inputDir/virtual/exp3.cubex" >> $logFile
$executable -i $inputDir/virtual/exp3.ipcg -c $inputDir/virtual/exp3.cubex >> $logFile 2>&1
echo "Invocation: $executable -i $inputDir/virtual/exp3.ipcg -c $inputDir/virtual/exp3.cubex" >>$logFile
$executable -i $inputDir/virtual/exp3.ipcg -c $inputDir/virtual/exp3.cubex >>$logFile 2>&1
checkErrorCode 0

#fix
echo "Invocation: $executable -i $inputDir/fix/miss.ipcg -c $inputDir/fix/0001.cubex -p" >> $logFile
$executable -i $inputDir/fix/miss.ipcg -c $inputDir/fix/0001.cubex -p -o $inputDir/fix/miss.ipcg.patched-${CI_CONCURRENT_ID} >> $logFile 2>&1
$executable -i $inputDir/fix/miss.ipcg.patched-${CI_CONCURRENT_ID} -c $inputDir/fix/0001.cubex >> $logFile 2>&1
echo "Invocation: $executable -i $inputDir/fix/miss.ipcg -c $inputDir/fix/0001.cubex -p" >>$logFile
$executable -i $inputDir/fix/miss.ipcg -c $inputDir/fix/0001.cubex -p -o $inputDir/fix/miss.ipcg.patched-${CI_CONCURRENT_ID} >>$logFile 2>&1
$executable -i $inputDir/fix/miss.ipcg.patched-${CI_CONCURRENT_ID} -c $inputDir/fix/0001.cubex >>$logFile 2>&1
checkErrorCode 0
echo "Invocation: $executable -i $inputDir/fixvirtual/miss.ipcg -c $inputDir/fixvirtual/exp1.cubex -p" >> $logFile
$executable -i $inputDir/fixvirtual/miss.ipcg -c $inputDir/fixvirtual/exp1.cubex -p -o $inputDir/fixvirtual/miss.ipcg.patched-${CI_CONCURRENT_ID}>> $logFile 2>&1
$executable -i $inputDir/fixvirtual/miss.ipcg.patched-${CI_CONCURRENT_ID} -c $inputDir/fixvirtual/exp1.cubex >> $logFile 2>&1
echo "Invocation: $executable -i $inputDir/fixvirtual/miss.ipcg -c $inputDir/fixvirtual/exp1.cubex -p" >>$logFile
$executable -i $inputDir/fixvirtual/miss.ipcg -c $inputDir/fixvirtual/exp1.cubex -p -o $inputDir/fixvirtual/miss.ipcg.patched-${CI_CONCURRENT_ID} >>$logFile 2>&1
$executable -i $inputDir/fixvirtual/miss.ipcg.patched-${CI_CONCURRENT_ID} -c $inputDir/fixvirtual/exp1.cubex >>$logFile 2>&1
checkErrorCode 0


# finalize
exit $fails

3 changes: 1 addition & 2 deletions cgcollector/test/integration/runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ fails=0
cd cgvalidate
bash cgvalidate-run.sh -b "$1"

fails=$(($fails+$?))
fails=$(($fails + $?))

echo Failed tests: $fails
exit $fails

1 change: 0 additions & 1 deletion cgcollector/test/run_aa_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ multiTests=(0042 0043 0044 0050 0053 0060)
# Multi-file aa tests
multiTestsAA=(0070 0071 0072 0214 0240 0241)


fails=0

# Single File
Expand Down
44 changes: 21 additions & 23 deletions cgcollector/test/testBase.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

cgcollectorExe=cgcollector
testerExe=cgsimpletester
cgmergeExe=cgmerge
Expand Down Expand Up @@ -26,7 +25,7 @@ function applyFileFormatOneToSingleTU {

echo "Running ${testerExe} on ${tfile}"
$cgcollectorExe --metacg-format-version=1 ${addFlags} --output ${gfile} $tfile -- >>log/testrun.log 2>&1
cat $gfile | python3 -m json.tool > ${gfile}_
cat $gfile | python3 -m json.tool >${gfile}_
mv ${gfile}_ ${gfile}
$testerExe $tgt $gfile >>log/testrun.log 2>&1

Expand Down Expand Up @@ -55,9 +54,9 @@ function applyFileFormatTwoToSingleTU {
gfile=${testCaseFile/cpp/ipcg}-${CI_CONCURRENT_ID}
tgt=${testCaseFile/cpp/gtmcg}

echo "Running tester on ${tfile}"
echo "Running tester on ${tfile}"
$cgcollectorExe --metacg-format-version=2 ${addFlags} --output ${gfile} $tfile -- >>log/testrun.log 2>&1
cat $gfile | python3 -m json.tool > ${gfile}_
cat $gfile | python3 -m json.tool >${gfile}_
mv ${gfile}_ ${gfile}
$testerExe $tgt $gfile >>log/testrun.log 2>&1

Expand All @@ -83,9 +82,9 @@ function applyFileFormatTwoToSingleTUWithAA {
gfile=${testCaseFile/cpp/ipcg}-${CI_CONCURRENT_ID}
tgt=${testCaseFile/cpp/gtaacg}

echo "Running tester on ${tfile}"
echo "Running tester on ${tfile}"
$cgcollectorExe --metacg-format-version=2 --capture-ctors-dtors --capture-stack-ctors-dtors --enable-AA ${addFlags} --output ${gfile} $tfile -- >>log/testrun.log 2>&1
cat $gfile | python3 -m json.tool > ${gfile}_
cat $gfile | python3 -m json.tool >${gfile}_
mv ${gfile}_ ${gfile}
$testerExe $tgt $gfile >>log/testrun.log 2>&1

Expand Down Expand Up @@ -220,7 +219,7 @@ function applyFileFormatTwoToMultiTUWithAA {

# Translation-unit-local
$cgcollectorExe --metacg-format-version=2 --capture-ctors-dtors --capture-stack-ctors-dtors --enable-AA --output ./input/multiTU/${ipcgTaFile} ./input/multiTU/$taFile -- >>log/testrun.log 2>&1
$cgcollectorExe --metacg-format-version=2 --capture-ctors-dtors --capture-stack-ctors-dtors --enable-AA --output ./input/multiTU/${ipcgTbFile} ./input/multiTU/$tbFile -- >>log/testrun.log 2>&1
$cgcollectorExe --metacg-format-version=2 --capture-ctors-dtors --capture-stack-ctors-dtors --enable-AA --output ./input/multiTU/${ipcgTbFile} ./input/multiTU/$tbFile -- >>log/testrun.log 2>&1

cat ./input/multiTU/${ipcgTaFile} | python3 -m json.tool >./input/multiTU/${ipcgTaFile}_
mv ./input/multiTU/${ipcgTaFile}_ ./input/multiTU/${ipcgTaFile}
Expand Down Expand Up @@ -255,23 +254,22 @@ function applyFileFormatTwoToMultiTUWithAA {
return $fail
}


while getopts ":b:h" opt; do
case $opt in
b)
if [ -z $OPTARG ]; then
echo "no build directory given, assuming \"build\""
fi
build_dir=$OPTARG
;;
h)
echo "use -b to provide a build directory NAME"
echo "use -h to print this help"
exit 0
;;
\?)
echo "Invalid option -$OPTARG"
exit 1
;;
b)
if [ -z $OPTARG ]; then
echo "no build directory given, assuming \"build\""
fi
build_dir=$OPTARG
;;
h)
echo "use -b to provide a build directory NAME"
echo "use -h to print this help"
exit 0
;;
\?)
echo "Invalid option -$OPTARG"
exit 1
;;
esac
done
1 change: 0 additions & 1 deletion formatSrc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ git-clang-format devel
# Apply CMake formatting
find . -name "CMakeLists.txt" -exec cmake-format -i {} \;
find ./cmake -name "*.cmake" -type f -exec cmake-format -i {} \;

43 changes: 21 additions & 22 deletions graph/test/integration/CallgraphMerge/MergeTestRunner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function merge {
fail=0
tc=$1
suffix="$2"

ipcgTaFile="${tc}_a${suffix}.ipcg"
ipcgTbFile="${tc}_b${suffix}.ipcg"
gtCombFile="${tc}_both${suffix}.gtmcg"
Expand All @@ -36,25 +36,25 @@ function merge {

while getopts ":b:h:g" opt; do
case $opt in
b)
if [ -z $OPTARG ]; then
echo "no build directory given, assuming \"build\""
fi
build_dir=$OPTARG
;;
h)
echo "use -b to provide a build directory NAME"
echo "use -h to print this help"
exit 0
;;
g)
echo "Regenerating ground truth files"
generate_gt=1
;;
\?)
echo "Invalid option -$OPTARG"
exit 1
;;
b)
if [ -z $OPTARG ]; then
echo "no build directory given, assuming \"build\""
fi
build_dir=$OPTARG
;;
h)
echo "use -b to provide a build directory NAME"
echo "use -h to print this help"
exit 0
;;
g)
echo "Regenerating ground truth files"
generate_gt=1
;;
\?)
echo "Invalid option -$OPTARG"
exit 1
;;
esac
done

Expand Down Expand Up @@ -82,5 +82,4 @@ for tc in "${tests[@]}"; do
done
echo "Test failures: $fails"


exit $fails
exit $fails
Loading