Skip to content

Commit

Permalink
Fixes the exit code return in benchmark run
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh committed Jun 14, 2024
1 parent 5dbb366 commit 5a3598c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion script/benchmark-program/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def preprocess(i):

if os_info['platform'] != 'windows' and str(env.get('CM_SAVE_CONSOLE_LOG', True)).lower() not in [ "no", "false", "0"]:
logs_dir = env.get('CM_LOGS_DIR', env['CM_RUN_DIR'])
env['CM_RUN_CMD'] += " 2>&1 | tee " + q+ os.path.join(logs_dir, "console.out") + q
env['CM_RUN_CMD'] += " 2>&1 ; echo \$? > exitstatus | tee " + q+ os.path.join(logs_dir, "console.out") + q

# Print info
print ('***************************************************************************')
Expand Down
13 changes: 11 additions & 2 deletions script/benchmark-program/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,19 @@ fi
# Check CM_RUN_CMD0
if [[ "${CM_RUN_CMD0}" != "" ]]; then
eval ${CM_RUN_CMD0}
test $? -eq 0 || exit $?
exitstatus=$?
if [ -e exitstatus ]; then
exitstatus=$( cat exitstatus )
fi
test $exitstatus -eq 0 || $exitstatus
else
echo "${CM_RUN_CMD}"
eval ${CM_RUN_CMD}
test $? -eq 0 || exit $?
exitstatus=$?
if [ -e exitstatus ]; then
exitstatus=$( cat exitstatus )
fi
test $exitstatus -eq 0 || $exitstatus
fi

test $? -eq 0 || exit $?

0 comments on commit 5a3598c

Please sign in to comment.