-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test script for analyzing a parent and child commit, where the ch…
…ild is analyzed with reluctant analysis.
- Loading branch information
0 parents
commit e8f3df2
Showing
1 changed file
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
PARENT=e7a254265f0c26c80fa1c04beb9eb14064f97d2f | ||
CHILD=ff9301567e2702f2790bef14963975f99a96f766 | ||
|
||
PARENT_OUT=parent.txt | ||
CHILD_OUT=child.txt | ||
|
||
# Script assumes to be executed in sibling folder of analyzer and chrony | ||
|
||
function build_comp_db { | ||
git clean -fdx | ||
./configure | ||
make -j 1 chronyd | tee build.log | ||
compiledb --parse build.log | ||
} | ||
|
||
function goto_chrony_dir { | ||
cd ../chrony | ||
} | ||
|
||
function goto_analyzer_dir { | ||
cd ../analyzer | ||
} | ||
|
||
function go_dir_up { | ||
cd .. | ||
} | ||
|
||
function checkout_and_build_commit { | ||
goto_chrony_dir | ||
git checkout $1 | ||
build_comp_db | ||
} | ||
|
||
function run_goblint_parent { | ||
goto_analyzer_dir | ||
./goblint --conf conf/custom/chrony.json -v --disable incremental.load --enable incremental.save ../chrony &> $PARENT_OUT | ||
} | ||
|
||
function run_goblint_child { | ||
goto_analyzer_dir | ||
./goblint --conf conf/custom/chrony-incrpostsolver.json -v --enable incremental.load --disable incremental.save --enable incremental.reluctant.enabled ../chrony &> $CHILD_OUT | ||
} | ||
|
||
function do_parent { | ||
checkout_and_build_commit $PARENT | ||
run_goblint_parent | ||
} | ||
|
||
function do_child { | ||
checkout_and_build_commit $CHILD | ||
run_goblint_child | ||
} | ||
|
||
function do_parent_and_child { | ||
do_parent | ||
do_child | ||
} | ||
|
||
function check_for_issue_by_name_in_file { | ||
grep -i $1 $2 | ||
} | ||
|
||
function check_file_for_fixpoint_issue { | ||
grep -i "Fixpoint" $1 | ||
} | ||
|
||
function check_file_for_exception { | ||
grep -i "exception" $1 | ||
grep -i "Called from" $1 | ||
} | ||
|
||
function check_file_for_issues { | ||
check_file_for_fixpoint_issue $1 | ||
check_file_for_exception $1 | ||
} | ||
|
||
function check_parent_and_child { | ||
goto_analyzer_dir | ||
for i in $PARENT_OUT $CHILD_OUT; do | ||
check_file_for_issues $i | ||
done | ||
go_dir_up | ||
} | ||
|
||
function analyze_and_check_parent_and_child { | ||
do_parent_and_child | ||
check_parent_and_child | ||
} | ||
|
||
analyze_and_check_parent_and_child | ||
|
||
|