2121# This script automates the execution of coremark. It will determine the
2222# set of default run parameters based on the system configuration.
2323#
24+ script_dir=$( realpath $( dirname $0 ) )
2425test_name=" passmark"
2526passmark_version=" v1.0"
2627curdir=` pwd`
27- script_dir=$( dirname $( realpath $0 ) )
2828copy_dirs=" "
29+ rtc=0
2930
3031if [ ! -f " /tmp/${test_name} .out" ]; then
3132 command=" ${0} $@ "
@@ -67,8 +68,6 @@ arch=`uname -m`
6768
6869show_usage=0
6970
70- # Gather hardware information
71- $curdir /test_tools/gather_data ${curdir}
7271
7372exit_out ()
7473{
@@ -111,7 +110,7 @@ usage()
111110 echo " $1 Usage:"
112111 echo " --cpu_add n: add n cpus each iteration until hit max cpus"
113112 echo " --powers_2: starting from 1 cpu, keep doubling the cpus until max cpus"
114- source ${curdir} /test_tools /general_setup --usage
113+ source ${TOOLS_BIN} /general_setup --usage
115114 exit 1
116115}
117116
@@ -143,9 +142,9 @@ produce_report()
143142 echo Ran > test_results_report
144143
145144 located=0
146- [ -f results .csv ] && rm results .csv
145+ [ -f results_passmark .csv ] && rm results_passmark .csv
147146
148- $TOOLS_BIN /test_header_info --front_matter --results_file results .csv --host $to_configuration --sys_type $to_sys_type --tuned $to_tuned_setting --results_version $passmark_version --test_name $test_name --field_header " Testname,Operations"
147+ $TOOLS_BIN /test_header_info --front_matter --results_file results_passmark .csv --host $to_configuration --sys_type $to_sys_type --tuned $to_tuned_setting --results_version $passmark_version --test_name $test_name --field_header " Testname,Operations"
149148
150149 while IFS= read -r line
151150 do
@@ -169,7 +168,7 @@ produce_report()
169168 ltest_name=` echo $line | cut -d' :' -f1`
170169 results=` echo $line | cut -d' ' -f2`
171170 data_string=$( build_data_string " ${ltest_name} " " ${results} " " ${start_time} " " ${end_time} " )
172- echo " ${data_string} " >> results .csv
171+ echo " ${data_string} " >> results_passmark .csv
173172 done < " $summary_file "
174173 fi
175174 echo Checksum: Not applicable for summary file >> $summary_file
@@ -207,8 +206,10 @@ install_tools()
207206 # Check to see if the test tools directory exists. If it does, we do not need to
208207 # clone the repo.
209208 #
210- if [ ! -d " test_tools" ]; then
211- git clone $tools_git test_tools
209+ TOOLS_BIN=${HOME} /test_tools
210+ export TOOLS_BIN
211+ if [ ! -d " ${TOOLS_BIN} " ]; then
212+ git clone $tools_git ${TOOLS_BIN}
212213 if [ $? -ne 0 ]; then
213214 exit_out " pulling git $tools_git failed." 1
214215 fi
@@ -344,12 +345,15 @@ run_passmark()
344345 if [[ -n " $copy_dirs " ]]; then
345346 copy_dirs=" --copy_dir $copy_dirs "
346347 fi
347-
348- ${curdir} /test_tools/save_results --curdir $curdir --home_root $to_home_root --results results.csv --test_name $test_name --tuned_setting=$to_tuned_setting --version NONE --user $to_user --other_files " passmark.summary,results_all_*,${test_name} _${iter} .out,test_results_report" $copy_dirs
348+ ${TOOLS_BIN} /csv_to_json $to_json_flags --csv_file results_passmark.csv --output_file results_passmark.json
349+ ${TOOLS_BIN} /verify_results $to_verify_flags --schema_file $script_dir /results_schema.py --class_name Passmark_Results --file results_passmark.json
350+ rtc=$?
351+ ${TOOLS_BIN} /save_results --curdir $curdir --home_root $to_home_root --results results_passmark.csv --test_name $test_name --tuned_setting=$to_tuned_setting --version NONE --user $to_user --other_files " passmark.summary,results_all_*,${test_name} _${iter} .out,test_results_report" $copy_dirs
349352 popd > /dev/null
350353}
351354
352355install_tools " $@ "
356+ $TOOLS_BIN /gather_data ${curdir}
353357
354358#
355359# Variables set by general setup.
@@ -364,7 +368,7 @@ install_tools "$@"
364368# to_tuned_setting: tuned setting
365369#
366370
367- source ${curdir} /test_tools /general_setup " $@ "
371+ source ${TOOLS_BIN} /general_setup " $@ "
368372if [[ $to_use_pcp -eq 1 ]]; then
369373 source $TOOLS_BIN /pcp/pcp_commands.inc
370374fi
427431$TOOLS_BIN /package_tool --no_packages $to_no_pkg_install --wrapper_config $script_dir /../passmark.json
428432
429433run_passmark
430- exit 0
434+ exit $rtc
0 commit comments