From dbe4a739f44ba9bfa9e5af6ab0b51ad6d1985100 Mon Sep 17 00:00:00 2001 From: David Valin Date: Fri, 13 Mar 2026 06:27:11 -0400 Subject: [PATCH 1/4] Handle multiple ways of install test_tools --- coremark/coremark_run | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/coremark/coremark_run b/coremark/coremark_run index 3c1ca3c..3d7aab1 100755 --- a/coremark/coremark_run +++ b/coremark/coremark_run @@ -85,6 +85,40 @@ usage() exit 0 } +attempt_tools_wget() +{ + if [[ ! -d "$TOOLS_BIN" ]]; then + wget ${tools_git}/archive/refs/heads/main.zip + if [[ $? -eq 0 ]]; then + unzip -q main.zip + mv test_tools-wrappers-main ${TOOLS_BIN} + rm main.zip + fi + fi +} + +attetmpt_tools_curl() +{ + if [[ ! -d "$TOOLS_BIN" ]]; then + curl -L -O ${tools_git}/archive/refs/heads/main.zip + if [[ $? -eq 0 ]]; then + unzip -q main.zip + mv test_tools-wrappers-main ${TOOLS_BIN} + rm main.zip + fi + fi +} + +attempt_tools_git() +{ + if [[ ! -d "$TOOLS_BIN" ]]; then + git clone $tools_git "$TOOLS_BIN" + if [ $? -ne 0 ]; then + exit_out "Error: pulling git $tools_git failed." 1 + fi + fi +} + install_test_tools() { # @@ -115,12 +149,9 @@ install_test_tools() # Check to see if the test tools directory exists. If it does, we do not need to # clone the repo. # - if [ ! -d "$TOOLS_BIN" ]; then - git clone $tools_git "$TOOLS_BIN" - if [ $? -ne 0 ]; then - exit_out "Error: pulling git $tools_git failed." 1 - fi - fi + attempt_tools_wget + attetmpt_tools_curl + attempt_tools_git if [ $show_usage -eq 1 ]; then usage $1 From a3981dcf489a5ff9c736882ffb1c454624c427a0 Mon Sep 17 00:00:00 2001 From: David Valin Date: Fri, 13 Mar 2026 07:48:10 -0400 Subject: [PATCH 2/4] Add proper error rtcs. --- coremark/coremark_run | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/coremark/coremark_run b/coremark/coremark_run index 3d7aab1..d6ccf1d 100755 --- a/coremark/coremark_run +++ b/coremark/coremark_run @@ -82,7 +82,7 @@ usage() echo " --cpu_add : starting at cpu count of 1, add this number of cpus to each run" echo " --powers_2s: starting at 1, run the number of cpus by powers of 2's" source $TOOLS_BIN/general_setup --usage - exit 0 + exit $E_USAGE } attempt_tools_wget() @@ -114,7 +114,7 @@ attempt_tools_git() if [[ ! -d "$TOOLS_BIN" ]]; then git clone $tools_git "$TOOLS_BIN" if [ $? -ne 0 ]; then - exit_out "Error: pulling git $tools_git failed." 1 + exit_out "Error: pulling git $tools_git failed." $E_GENERAL fi fi } @@ -197,7 +197,7 @@ execute_coremark() add_time_to_run_log run1.log "$cm_start_time" "$cm_end_time" add_time_to_run_log run2.log "$cm_start_time" "$cm_end_time" if [ $? -ne 0 ]; then - exit_out "Failed: make XCFLAGS=\"${make_flags}\"" 1 + exit_out "Failed: make XCFLAGS=\"${make_flags}\"" $E_GENERAL fi # If we're using PCP, snap the chalk line at the end of the iteration @@ -434,7 +434,7 @@ while [[ $# -gt 0 ]]; do done if [ $powers_2 -ne 0 ] && [ $cpu_add -ne 0 ]; then - exit_out "Error, can not designate both cpu_add and powers_2" 1 + exit_out "Error, can not designate both cpu_add and powers_2" $E_GENERAL fi if [ -d /${to_home_root}/${to_user} ]; then @@ -455,17 +455,17 @@ else if [[ $commit == "none" ]]; then GIT_TERMINAL_PROMPT=0 git clone --depth 1 --branch ${coremark_version} https://github.com/eembc/coremark if [ $? -ne 0 ]; then - exit_out "Failed: git clone --depth 1 --branch ${coremark_version} https://github.com/eembc/coremark" 1 + exit_out "Failed: git clone --depth 1 --branch ${coremark_version} https://github.com/eembc/coremark" $E_GENERAL fi else GIT_TERMINAL_PROMPT=0 git clone https://github.com/eembc/coremark if [ $? -ne 0 ]; then - exit_out "Failed: git clone https://github.com/eembc/coremark" 1 + exit_out "Failed: git clone https://github.com/eembc/coremark" $E_GENERAL fi pushd coremark > /dev/null GIT_TERMINAL_PROMPT=0 git checkout ${commit} if [ $? -ne 0 ]; then - exit_out "Failed: git checkout ${commit}" 1 + exit_out "Failed: git checkout ${commit}" $E_GENERAL fi popd > /dev/null fi @@ -496,5 +496,4 @@ fi generate_results -exit 0 - +exit $E_SUCCESS From 6a5c1257927be0a59786a0a9eff480c794c8dbe6 Mon Sep 17 00:00:00 2001 From: David Valin Date: Fri, 13 Mar 2026 07:50:48 -0400 Subject: [PATCH 3/4] Can not return $E_GENERAL on installing tools, tools is not installed, so can not source error_codes --- coremark/coremark_run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coremark/coremark_run b/coremark/coremark_run index d6ccf1d..56883fa 100755 --- a/coremark/coremark_run +++ b/coremark/coremark_run @@ -114,7 +114,7 @@ attempt_tools_git() if [[ ! -d "$TOOLS_BIN" ]]; then git clone $tools_git "$TOOLS_BIN" if [ $? -ne 0 ]; then - exit_out "Error: pulling git $tools_git failed." $E_GENERAL + exit_out "Error: pulling git $tools_git failed." 101 fi fi } From 1448188ab72ffcfff71edfb0a67e57ecebe668b1 Mon Sep 17 00:00:00 2001 From: David Valin Date: Fri, 13 Mar 2026 11:16:21 -0400 Subject: [PATCH 4/4] Fix typo --- coremark/coremark_run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coremark/coremark_run b/coremark/coremark_run index 56883fa..dd66634 100755 --- a/coremark/coremark_run +++ b/coremark/coremark_run @@ -97,7 +97,7 @@ attempt_tools_wget() fi } -attetmpt_tools_curl() +attempt_tools_curl() { if [[ ! -d "$TOOLS_BIN" ]]; then curl -L -O ${tools_git}/archive/refs/heads/main.zip @@ -150,7 +150,7 @@ install_test_tools() # clone the repo. # attempt_tools_wget - attetmpt_tools_curl + attempt_tools_curl attempt_tools_git if [ $show_usage -eq 1 ]; then