From 06f18242fedb67280c425e9e7b533326445580b1 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Sat, 17 Dec 2022 03:11:53 -0800 Subject: [PATCH] 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 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/66772 Reviewed-by: Matt Sinclair Maintainer: Matt Sinclair Maintainer: Bobby Bruce Reviewed-by: Jason Lowe-Power Tested-by: kokoro --- tests/compiler-tests.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/compiler-tests.sh b/tests/compiler-tests.sh index f16e8e5fdb..f5d4bb189f 100755 --- a/tests/compiler-tests.sh +++ b/tests/compiler-tests.sh @@ -76,7 +76,13 @@ builds_per_compiler=1 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 +141,7 @@ for compiler in ${images[@]}; do 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=$?