Skip to content

Commit

Permalink
small improvements to test_reopt_with_relink.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Ptival committed Jun 16, 2023
1 parent de166b6 commit cbbc174
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/test_reopt_with_relink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ run_reopt () {
NUM_BINARIES=$(($NUM_BINARIES+1))
$1
PRE_RESULT=$?
$REOPT $1 --lib-dir=lib64 --debug-dir=debug-lib64 --output=$1.reopt
# 1. If you want no output from reopt:
# $REOPT $1 --lib-dir=lib64 --debug-dir=debug-lib64 --output=$1.reopt 1>/dev/null 2>/dev/null
# 2. If you want to pipe into less:
$REOPT $1 --lib-dir=lib64 --debug-dir=debug-lib64 --output=$1.reopt 2>&1
if [[ $? -ne 0 ]]; then
echo "Reopt terminated with a non-zero exit code on $1"
NUM_BAD=$(($NUM_BAD+1))
Expand All @@ -47,11 +50,10 @@ report_results() {
echo "$NUM_PASS binaries behaved identically after reopt ran."
echo "$NUM_FAIL binaries behaved differently after reopt ran."
if [[ $NUM_BAD -ne 0 ]]; then
echo "$NUM_FAIL binaries behaved differently after reopt ran."
echo "$NUM_BAD binaries caused reopt to fail."
fi
}


DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

CENTOS7_DEV_DIR="$DIR/../deps/reopt-benchmark-binaries/centos7-dev"
Expand All @@ -72,6 +74,7 @@ elif [[ $1 == "small" ]]; then
run_reopt bin/mkdir
run_reopt bin/curl
run_reopt bin/date
report_results
popd > /dev/null # $CENTOS7_DEV_DIR
elif [[ $1 == "all" ]]; then
echo "Running reopt on all centos7-dev binaries..."
Expand Down

0 comments on commit cbbc174

Please sign in to comment.