Skip to content
Snippets Groups Projects
Commit 17b1153a authored by bdr7fv's avatar bdr7fv
Browse files

Put in some additional sanity checking in how manual coverage is generated.


Former-commit-id: c0f9d4d02cf5cc480c891645daa3bfd7f2c5b2cc
parent 6906261a
No related branches found
No related tags found
No related merge requests found
......@@ -20,13 +20,17 @@ if [ -f $MANUAL_TEST_SCRIPT ]; then
echo "$MANUAL_COV_SCRIPT $ORIG_BIN $MANUAL_TEST_SCRIPT $AGGREGATE_COVERAGE"
eval $MANUAL_COV_SCRIPT $ORIG_BIN $MANUAL_TEST_SCRIPT $AGGREGATE_COVERAGE
return $?
fi
#the remainder of this file is for Anh's old manual tests
#which I will keep around for now, but ignore this code.
return 0
ls $MANUAL_TEST_DIR/* >/dev/null 2>/dev/null
if [ ! $? -eq 0 ]; then
echo "do_manual_cover.sh: error: no manual test specifications found -- exiting"
echo "do_manual_cover.sh: no manual test specifications found -- exiting"
exit 1
fi
......
......@@ -67,16 +67,20 @@ mkdir $P1_DIR
# fi
#fi
touch $EXECUTED_ADDRESSES_FINAL
# generate coverage info for manually-specified tests (if any)
$PEASOUP_HOME/tools/do_manual_cover.sh
if [[ ! $? -eq 0 ]]; then
echo "ERROR: Manual coverage failed"
#continue for now, but don't encorporate manual coverage data.
else
# merge all execution traces if successfully run
cat $EXECUTED_ADDRESSES_MANUAL >> $EXECUTED_ADDRESSES_FINAL
fi
echo "manual cover finished"
# merge all execution traces
touch $EXECUTED_ADDRESSES_FINAL
cat $EXECUTED_ADDRESSES_MANUAL >> $EXECUTED_ADDRESSES_FINAL
echo "Replaying all .json files"
input_cnt=0
REPLAY_DEADLINE=$(( `date +'%s'` + $COVERAGE_REPLAY_TIMEOUT ))
......
......@@ -8,7 +8,8 @@
BENCH=$1
TEST_SCRIPT=$2
MANUAL_EXE_ADDRESS_OUTPUT_FILE=$3
#A coverage round that takes longer than 10 minutes is assumed to be an infinite loop.
TIMEOUT_VALUE=600
PIN_BENCH=`pwd`/pin_bench
COVERAGE_RESULTS_FILE=$PEASOUP_HOME/coverage_results/itrace.out
......@@ -33,11 +34,13 @@ eval $TEST_SCRIPT -i $PIN_BENCH $BENCH
#because I now have an ignore flag, this likely won't occur, but just in case.
if [ $? -ne 0 ]; then
echo "WARNING: manual coverage failed. The running manual tests reported failure with coverage instrumentation. Continuing with coverage that was collected."
echo "ERROR: manual coverage failed. The running manual tests reported failure with coverage instrumentation. Ignoring coverage results."
exit 1
fi
# sanity filter, keep only well formed addresses
cat $COVERAGE_RESULTS_FILE | sed 's/.*\(0x.*\)/\1/' >tmp
cat $COVERAGE_RESULTS_FILE | sed 's/\(.*0x.*\)/\1/' >tmp
mv tmp $COVERAGE_RESULTS_FILE
cp $COVERAGE_RESULTS_FILE $MANUAL_EXE_ADDRESS_OUTPUT_FILE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment