Bobby R. Bruce has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/31534 )

Change subject: util,tests: Updated compiler-tests to support paths with spaces
......................................................................

util,tests: Updated compiler-tests to support paths with spaces

This script was failing if the gem5 directory path contained a space.
E.g: `/home/bobbys home/gem5`. This script has thereby been improved to
handle this.

Change-Id: Id56ff5a0e9aa31eef14de2111b040f7f2b0b286c
---
M util/compiler-tests.sh
1 file changed, 19 insertions(+), 18 deletions(-)



diff --git a/util/compiler-tests.sh b/util/compiler-tests.sh
index 30ce637..c586c27 100755
--- a/util/compiler-tests.sh
+++ b/util/compiler-tests.sh
@@ -70,14 +70,14 @@
 exits="${test_dir}/exit-codes.csv"

 # Create the testing output directory and files
-rm -rf $test_dir_final
-rm -rf $test_dir
-mkdir $test_dir
-touch $exits
-echo "compiler,build_target,exit_code" >> $exits
+rm -rf "${test_dir_final}"
+rm -rf "${test_dir}"
+mkdir "${test_dir}"
+touch "${exits}"
+echo "compiler,build_target,exit_code" >> "${exits}"

 for compiler in ${images[@]}; do
-    echo "Starting build tests with '$compiler'..."
+    echo "Starting build tests with '${compiler}'..."
     # Generate a randomized list of build targets
     build_permutation=($(shuf -i 0-$((${#builds[@]} - 1)) ))

@@ -96,33 +96,34 @@
     # Grab compiler image
     docker pull $repo_name >/dev/null

-    mkdir "$test_dir/$compiler"
+    mkdir "${test_dir}/${compiler}"

     for build_index in ${build_indices[@]}; do
         for build_opt in ${opts[@]}; do
             build="${builds[$build_index]}"
             build_out="build/$build/gem5$build_opt"
-            build_stdout="$test_dir/$compiler/$build$build_opt.stdout"
-            build_stderr="$test_dir/$compiler/$build$build_opt.stderr"
+ build_stdout="${test_dir}/${compiler}/${build}${build_opt}.stdout" + build_stderr="${test_dir}/${compiler}/${build}${build_opt}.stderr"

             # Clean the build
             rm -rf "${build_dir}"

-            touch $build_stdout
-            touch $build_stderr
+            touch "${build_stdout}"
+            touch "${build_stderr}"

- echo " * Building target '$build$build_opt' with '$compiler'..." + echo " * Building target '${build}${build_opt}' with '${compiler}'..."

             # Build with container
             {
- docker run --rm -v ${gem5_root}:/gem5 -u $UID:$GID -w /gem5 \
-                    $repo_name scons $build_out $build_args
-            }>$build_stdout 2>$build_stderr
+                docker run --rm -v "${gem5_root}":"/gem5" -u $UID:$GID \
+ -w /gem5 $repo_name scons "${build_out}" "${build_args}"
+            }>"${build_stdout}" 2>"${build_stderr}"
             result=$?

-            echo "$compiler,$build/gem5$build_opt,$result" >> $exits
-            if [ $result -ne 0 ]; then
-                echo "  ! Failed with exit code $result."
+ echo "${compiler},${build}/gem5${build_opt},${result}"
"${exits}"
+
+            if [ ${result} -ne 0 ]; then
+                echo "  ! Failed with exit code ${result}."
             else
                 echo "    Done."
             fi

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/31534
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Id56ff5a0e9aa31eef14de2111b040f7f2b0b286c
Gerrit-Change-Number: 31534
Gerrit-PatchSet: 1
Gerrit-Owner: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to