Bobby Bruce has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/66772?usp=email )

Change subject: tests: Fix compiler-tests.sh build args passing
......................................................................

tests: Fix compiler-tests.sh build args passing

Reverts this fix:
https://gem5-review.googlesource.com/c/public/gem5/+/66631

While this did fix the case where no build args were passed, it broke
the case where build args were passed.

This fix ensures the script works in both cases.

Change-Id: I6cc8cc0c2a10c801d4a59e54b070383ac8ee93ae
---
M tests/compiler-tests.sh
1 file changed, 26 insertions(+), 2 deletions(-)



diff --git a/tests/compiler-tests.sh b/tests/compiler-tests.sh
index f16e8e5..824bc9b 100755
--- a/tests/compiler-tests.sh
+++ b/tests/compiler-tests.sh
@@ -75,8 +75,15 @@
 # Base URL of the gem5 testing images.
 base_url="gcr.io/gem5-test"

+
 # Arguments passed into scons on every build target test.
-build_args="$@"
+if [ $# -eq 0 ];then
+ # If none is sepcified by the user we pass "-j1" (compile on one thread).
+    # If `build_args` is left as an empty string, this script will fail.
+    build_args="-j1"
+else
+    build_args="$@"
+fi

 # Testing directory variables
 mkdir -p "${build_dir}" # Create the build directory if it doesn't exist.
@@ -135,7 +142,7 @@
                 docker run --rm -v "${gem5_root}":"/gem5" -u $UID:$GID \
                     -w /gem5 --memory="${docker_mem_limit}" $repo_name \
                     /usr/bin/env python3 /usr/bin/scons --ignore-style \
-                    "${build_out} ${build_args}"
+                    "${build_out}" "${build_args}"
             }>"${build_stdout}" 2>"${build_stderr}"
             result=$?


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/66772?usp=email 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: I6cc8cc0c2a10c801d4a59e54b070383ac8ee93ae
Gerrit-Change-Number: 66772
Gerrit-PatchSet: 1
Gerrit-Owner: Bobby 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

Reply via email to