Leonardo Sandoval | 9dfdd1b | 2020-08-06 17:08:11 -0500 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 2 | # |
laurenw-arm | afdc3bc | 2022-09-14 15:31:42 -0500 | [diff] [blame] | 3 | # Copyright (c) 2019-2022, Arm Limited. All rights reserved. |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 4 | # |
| 5 | # SPDX-License-Identifier: BSD-3-Clause |
| 6 | # |
| 7 | |
| 8 | set -e |
| 9 | |
| 10 | in_red() { |
| 11 | echo "$(tput setaf 1)${1:?}$(tput sgr0)" |
| 12 | } |
| 13 | export -f in_red |
| 14 | |
| 15 | in_green() { |
| 16 | echo "$(tput setaf 2)${1:?}$(tput sgr0)" |
| 17 | } |
| 18 | export -f in_green |
| 19 | |
| 20 | in_yellow() { |
| 21 | echo "$(tput setaf 3)${1:?}$(tput sgr0)" |
| 22 | } |
| 23 | export -f in_yellow |
| 24 | |
| 25 | print_success() { |
| 26 | in_green "$1: SUCCESS" |
| 27 | } |
| 28 | export -f print_success |
| 29 | |
| 30 | print_failure() { |
| 31 | in_red "$1: FAILURE" |
| 32 | } |
| 33 | export -f print_failure |
| 34 | |
| 35 | print_unstable() { |
| 36 | in_yellow "$1: UNSTABLE" |
| 37 | } |
| 38 | export -f print_unstable |
| 39 | |
| 40 | gen_makefile() { |
| 41 | local num="$(find -name "*.test" -type f | wc -l)" |
| 42 | local i=0 |
| 43 | |
| 44 | cat <<EOF >Makefile |
| 45 | SHELL=/bin/bash |
| 46 | |
| 47 | all: |
| 48 | |
| 49 | EOF |
| 50 | |
| 51 | # If we're using local checkouts for either TF or TFTF, we must |
| 52 | # serialise builds |
| 53 | while [ "$i" -lt "$num" ]; do |
| 54 | { |
Sandrine Bailleux | 4694fd3 | 2022-04-15 14:04:35 +0200 | [diff] [blame] | 55 | printf "all: %04d_run %04d_build\n" "$i" "$i" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 56 | if upon "$serialize_builds" && [ "$i" -gt 0 ]; then |
Sandrine Bailleux | 4694fd3 | 2022-04-15 14:04:35 +0200 | [diff] [blame] | 57 | printf "%04d_build: %04d_build\n" "$i" "$((i - 1))" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 58 | fi |
| 59 | echo |
| 60 | } >>Makefile |
| 61 | let "++i" |
| 62 | done |
| 63 | |
| 64 | cat <<EOF >>Makefile |
| 65 | |
| 66 | %_run: %_build |
| 67 | @run_one_test "\$@" |
| 68 | |
| 69 | %_build: |
| 70 | @run_one_test "\$@" |
| 71 | EOF |
| 72 | } |
| 73 | |
| 74 | # This function is invoked from the Makefile. Descriptor 5 points to the active |
| 75 | # terminal. |
| 76 | run_one_test() { |
| 77 | id="${1%%_*}" |
| 78 | action="${1##*_}" |
| 79 | test_file="$(find -name "$id*.test" -printf "%f\n")" |
| 80 | |
| 81 | mkdir -p "$id" |
| 82 | |
| 83 | # Copy the test_file into the workspace directory with the name |
| 84 | # TEST_DESC, just like Jenkins would. |
| 85 | export TEST_DESC="$(basename "$test_file")" |
| 86 | cp "$test_file" "$id/TEST_DESC" |
| 87 | |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 88 | workspace="$id" test_desc="$test_file" cc_enable="$cc_enable" "$ci_root/script/parse_test.sh" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 89 | |
| 90 | set -a |
| 91 | source "$id/env" |
| 92 | set +a |
| 93 | |
| 94 | # Makefiles don't like commas and colons in file names. We therefore |
| 95 | # replace them with _ |
| 96 | config_subst="$(echo "$TEST_CONFIG" | tr ',:' '_')" |
| 97 | config_string="$id: $TEST_GROUP/$TEST_CONFIG" |
| 98 | workspace="$workspace/$TEST_GROUP/$config_subst" |
| 99 | mkdir -p "$workspace" |
| 100 | |
| 101 | log_file="$workspace/artefacts/build.log" |
| 102 | if [ "$parallel" -gt 1 ]; then |
| 103 | console_file="$workspace/console.log" |
| 104 | exec 6>>"$console_file" |
| 105 | else |
| 106 | exec 6>&5 |
| 107 | fi |
| 108 | |
| 109 | # Unset make flags for build script |
| 110 | MAKEFLAGS= |
| 111 | |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 112 | if [ $import_cc -eq 1 ]; then |
| 113 | # Path to plugin if there is no local reference |
| 114 | cc_path_spec=$workspace/cc_plugin |
| 115 | fi |
| 116 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 117 | case "$action" in |
| 118 | "build") |
| 119 | echo "building: $config_string" >&5 |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 120 | if ! ccpathspec="$cc_path_spec" bash $minus_x "$ci_root/script/build_package.sh" \ |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 121 | >&6 2>&1; then |
| 122 | { |
| 123 | print_failure "$config_string (build)" |
| 124 | if [ "$console_file" ]; then |
| 125 | echo " see $console_file" |
| 126 | fi |
| 127 | } >&5 |
| 128 | exit 1 |
| 129 | fi |
| 130 | ;; |
| 131 | |
| 132 | "run") |
Harrison Mutai | a197d5d | 2022-09-15 13:45:21 +0100 | [diff] [blame] | 133 | # Local runs for FVP, QEMU, or arm_fpga unless asked not to |
| 134 | if echo "$RUN_CONFIG" | grep -q "^\(fvp\|qemu\)" && \ |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 135 | not_upon "$skip_runs"; then |
| 136 | echo "running: $config_string" >&5 |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 137 | if [ -n "$cc_enable" ]; then |
| 138 | # Enable of code coverage during run |
| 139 | if cc_enable="$cc_enable" trace_file_prefix=tr \ |
| 140 | coverage_trace_plugin=$cc_path_spec/scripts/tools/code_coverage/fastmodel_baremetal/bmcov/model-plugin/CoverageTrace.so \ |
| 141 | bash $minus_x "$ci_root/script/run_package.sh" \ |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 142 | >&6 2>&1; then |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 143 | if grep -q -e "--BUILD UNSTABLE--" \ |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 144 | "$log_file"; then |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 145 | print_unstable "$config_string" >&5 |
| 146 | else |
| 147 | print_success "$config_string" >&5 |
| 148 | if [ -d "$workspace/artefacts/release" ] && \ |
laurenw-arm | afdc3bc | 2022-09-14 15:31:42 -0500 | [diff] [blame] | 149 | [ -f "$workspace/artefacts/release/tr-FVP_Base_RevC_2xAEMvA.cluster0.cpu0.log" ]; then |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 150 | cp $workspace/artefacts/release/*.log $workspace/artefacts/debug |
| 151 | fi |
| 152 | # Setting environmental variables for run of code coverage |
| 153 | OBJDUMP=$TOOLCHAIN/bin/aarch64-none-elf-objdump \ |
| 154 | READELF=$TOOLCHAIN/bin/aarch64-none-elf-readelf \ |
| 155 | ELF_FOLDER=$workspace/artefacts/debug \ |
| 156 | TRACE_FOLDER=$workspace/artefacts/debug \ |
| 157 | workspace=$workspace \ |
| 158 | TRACE_PREFIX=tr python \ |
| 159 | $cc_path_spec/scripts/tools/code_coverage/fastmodel_baremetal/bmcov/report/gen-coverage-report.py --config \ |
| 160 | $cc_path_spec/scripts/tools/code_coverage/fastmodel_baremetal/bmcov/report/config_atf.py |
| 161 | fi |
| 162 | exit 0 |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 163 | else |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 164 | { |
| 165 | print_failure "$config_string (run)" |
| 166 | if [ "$console_file" ]; then |
| 167 | echo " see $console_file" |
| 168 | fi |
| 169 | } >&5 |
| 170 | exit 1 |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 171 | fi |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 172 | else |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 173 | if bash $minus_x "$ci_root/script/run_package.sh" \ |
| 174 | >&6 2>&1; then |
| 175 | if grep -q -e "--BUILD UNSTABLE--" \ |
| 176 | "$log_file"; then |
| 177 | print_unstable "$config_string" >&5 |
| 178 | else |
| 179 | print_success "$config_string" >&5 |
| 180 | fi |
| 181 | exit 0 |
| 182 | else |
| 183 | { |
| 184 | print_failure "$config_string (run)" |
| 185 | if [ "$console_file" ]; then |
| 186 | echo " see $console_file" |
| 187 | fi |
| 188 | } >&5 |
| 189 | exit 1 |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 190 | fi |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 191 | fi |
| 192 | else |
Javier Almansa Sobrino | 412d361 | 2020-05-22 17:53:12 +0100 | [diff] [blame] | 193 | # Local runs for arm_fpga platform |
| 194 | if echo "$RUN_CONFIG" | grep -q "^arm_fpga" && \ |
| 195 | not_upon "$skip_runs"; then |
| 196 | echo "running: $config_string" >&5 |
| 197 | if bash $minus_x "$ci_root/script/test_fpga_payload.sh" \ |
| 198 | >&6 2>&1; then |
| 199 | if grep -q -e "--BUILD UNSTABLE--" \ |
| 200 | "$log_file"; then |
| 201 | print_unstable "$config_string" >&5 |
| 202 | else |
| 203 | print_success "$config_string" >&5 |
| 204 | fi |
| 205 | exit 0 |
| 206 | else |
| 207 | { |
| 208 | print_failure "$config_string (run)" |
| 209 | if [ "$console_file" ]; then |
| 210 | echo " see $console_file" |
| 211 | fi |
| 212 | } >&5 |
| 213 | exit 1 |
| 214 | fi |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 215 | else |
Javier Almansa Sobrino | 412d361 | 2020-05-22 17:53:12 +0100 | [diff] [blame] | 216 | if grep -q -e "--BUILD UNSTABLE--" \ |
| 217 | "$log_file"; then |
| 218 | print_unstable "$config_string (not run)" >&5 |
| 219 | else |
| 220 | print_success "$config_string (not run)" >&5 |
| 221 | fi |
| 222 | exit 0 |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 223 | fi |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 224 | fi |
| 225 | ;; |
| 226 | |
| 227 | *) |
| 228 | in_red "Invalid action: $action!" >&5 |
| 229 | exit 1 |
| 230 | ;; |
| 231 | esac |
| 232 | } |
| 233 | export -f run_one_test |
| 234 | |
| 235 | workspace="${workspace:?}" |
| 236 | ci_root="$(readlink -f "$(dirname "$0")/..")" |
| 237 | |
| 238 | # If this script was invoked with bash -x, have subsequent build/run invocations |
| 239 | # to use -x as well. |
| 240 | if echo "$-" | grep -q "x"; then |
| 241 | export minus_x="-x" |
| 242 | fi |
| 243 | |
Leonardo Sandoval | 8f9cea6 | 2020-07-10 11:08:55 -0500 | [diff] [blame] | 244 | # if test_groups variable is not present, check if it can be formed at least from 'test_group' and 'tf_config' |
| 245 | # environment variables |
| 246 | if [ -z "${test_groups}" ]; then |
| 247 | if [ -n "${test_group}" -a -n "${tf_config}" ]; then |
| 248 | |
| 249 | # default the rest to nil if not present |
| 250 | tftf_config="${tftf_config:-nil}" |
| 251 | scp_config="${scp_config:-nil}" |
| 252 | scp_tools="${scp_tools:-nil}" |
Manish Pandey | b466cf2 | 2021-02-12 13:15:40 +0000 | [diff] [blame] | 253 | spm_config="${spm_config:-nil}" |
Leonardo Sandoval | 8f9cea6 | 2020-07-10 11:08:55 -0500 | [diff] [blame] | 254 | run_config="${run_config:-nil}" |
| 255 | |
Manish Pandey | b466cf2 | 2021-02-12 13:15:40 +0000 | [diff] [blame] | 256 | # construct the 'long form' so it takes into account all possible configurations |
Leonardo Sandoval | 07733aa | 2021-02-23 13:57:08 -0600 | [diff] [blame] | 257 | if echo ${test_group} | grep -q '^scp-'; then |
Manish Pandey | b466cf2 | 2021-02-12 13:15:40 +0000 | [diff] [blame] | 258 | tg=$(printf "%s/%s,%s,%s,%s:%s" "${test_group}" "${scp_config}" "${tf_config}" "${tftf_config}" "${scp_tools}" "${run_config}") |
Leonardo Sandoval | 07733aa | 2021-02-23 13:57:08 -0600 | [diff] [blame] | 259 | elif echo ${test_group} | grep -q '^spm-'; then |
Manish Pandey | b466cf2 | 2021-02-12 13:15:40 +0000 | [diff] [blame] | 260 | tg=$(printf "%s/%s,%s,%s,%s,%s:%s" "${test_group}" "${spm_config}" "${tf_config}" "${tftf_config}" "${scp_config}" "${scp_tools}" "${run_config}") |
| 261 | else |
| 262 | tg=$(printf "%s/%s,%s,%s,%s,%s:%s" "${test_group}" "${tf_config}" "${tftf_config}" "${scp_config}" "${scp_tools}" "${spm_config}" "${run_config}") |
| 263 | fi |
Leonardo Sandoval | 8f9cea6 | 2020-07-10 11:08:55 -0500 | [diff] [blame] | 264 | |
| 265 | # trim any ',nil:' from it |
Manish Pandey | b466cf2 | 2021-02-12 13:15:40 +0000 | [diff] [blame] | 266 | tg="${tg/,nil:/:}" tg="${tg/,nil:/:}"; tg="${tg/,nil:/:}"; tg="${tg/,nil:/:}" |
Leonardo Sandoval | 8f9cea6 | 2020-07-10 11:08:55 -0500 | [diff] [blame] | 267 | |
| 268 | # finally exported |
| 269 | export test_groups="${tg}" |
| 270 | fi |
| 271 | fi |
| 272 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 273 | # For a local run, when some variables as specified as "?", launch zenity to |
| 274 | # prompt for test config via. GUI. If it's "??", then choose a directory. |
| 275 | if [ "$test_groups" = "?" -o "$test_groups" = "??" ]; then |
| 276 | zenity_opts=( |
| 277 | --file-selection |
| 278 | --filename="$ci_root/group/README" |
| 279 | --multiple |
| 280 | --title "Choose test config" |
| 281 | ) |
| 282 | |
| 283 | if [ "$test_groups" = "??" ]; then |
| 284 | zenity_opts+=("--directory") |
| 285 | fi |
| 286 | |
| 287 | # In case of multiple selections, zenity returns absolute paths of files |
| 288 | # separated by '|'. We remove the pipe characters, and make the paths |
| 289 | # relative to the group directory. |
| 290 | selections="$(cd "$ci_root"; zenity ${zenity_opts[*]})" |
| 291 | test_groups="$(echo "$selections" | tr '|' ' ')" |
| 292 | test_groups="$(echo "$test_groups" | sed "s#$ci_root/group/##g")" |
| 293 | fi |
| 294 | |
| 295 | test_groups="${test_groups:?}" |
| 296 | local_count=0 |
| 297 | |
| 298 | if [ -z "$tf_root" ]; then |
| 299 | in_red "NOTE: NOT using local work tree for TF" |
| 300 | else |
| 301 | tf_root="$(readlink -f $tf_root)" |
| 302 | tf_refspec= |
| 303 | in_green "Using local work tree for TF" |
| 304 | let "++local_count" |
| 305 | fi |
| 306 | |
| 307 | if [ -z "$tftf_root" ]; then |
| 308 | in_red "NOTE: NOT using local work tree for TFTF" |
| 309 | tforg_user="${tforg_user:?}" |
| 310 | else |
| 311 | tftf_root="$(readlink -f $tftf_root)" |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 312 | tftf_refspec= |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 313 | in_green "Using local work tree for TFTF" |
| 314 | let "++local_count" |
| 315 | fi |
| 316 | |
| 317 | if [ -z "$scp_root" ]; then |
| 318 | in_red "NOTE: NOT using local work tree for SCP" |
| 319 | else |
| 320 | scp_root="$(readlink -f $scp_root)" |
| 321 | scp_refspec= |
| 322 | in_green "Using local work tree for SCP" |
| 323 | let "++local_count" |
| 324 | fi |
| 325 | |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 326 | if [ -n "$cc_enable" ]; then |
| 327 | in_green "Code Coverage enabled" |
| 328 | if [ -z "$TOOLCHAIN" ]; then |
| 329 | in_red "TOOLCHAIN not set for code coverage: ex: export TOOLCHAIN=<path to toolchain>/gcc-arm-<gcc version>-x86_64-aarch64-none-elf" |
| 330 | exit 1 |
| 331 | fi |
| 332 | if [ -n "$cc_path" ]; then |
| 333 | in_green "Code coverage plugin path specified" |
| 334 | cc_path_spec=$cc_path |
| 335 | import_cc=0 |
| 336 | else |
| 337 | in_red "Code coverage plugin path not specified" |
| 338 | cc_path_spec="$workspace/cc_plugin" |
| 339 | import_cc=1 |
| 340 | fi |
Jimmy Brisson | 4347d8a | 2020-07-24 10:26:16 -0500 | [diff] [blame] | 341 | else |
| 342 | in_green "Code coverage disabled" |
| 343 | import_cc=1 |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 344 | fi |
| 345 | |
Olivier Deprez | f1d1fcd | 2019-12-16 14:09:43 +0100 | [diff] [blame] | 346 | if [ -z "$spm_root" ]; then |
| 347 | in_red "NOTE: NOT using local work tree for SPM" |
| 348 | else |
| 349 | spm_root="$(readlink -f $spm_root)" |
| 350 | spm_refspec= |
| 351 | in_green "Using local work tree for SPM" |
| 352 | let "++local_count" |
| 353 | fi |
| 354 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 355 | # User preferences |
Javier Almansa Sobrino | e836318 | 2020-11-10 16:40:53 +0000 | [diff] [blame] | 356 | [ "$connect_debugger" ] && [ "$connect_debugger" -eq 1 ] && user_connect_debugger=1 |
| 357 | user_test_run="${user_connect_debugger:-$test_run}" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 358 | user_dont_clean="$dont_clean" |
| 359 | user_keep_going="$keep_going" |
| 360 | user_primary_live="$primary_live" |
Javier Almansa Sobrino | e836318 | 2020-11-10 16:40:53 +0000 | [diff] [blame] | 361 | user_connect_debugger="${user_connect_debugger:-0}" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 362 | |
| 363 | export ci_root |
| 364 | export dont_clean=0 |
| 365 | export local_ci=1 |
| 366 | export parallel |
| 367 | export test_run=0 |
| 368 | export primary_live=0 |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 369 | export cc_path_spec |
| 370 | export import_cc |
Javier Almansa Sobrino | e836318 | 2020-11-10 16:40:53 +0000 | [diff] [blame] | 371 | export connect_debugger="$user_connect_debugger" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 372 | |
| 373 | rm -rf "$workspace" |
| 374 | mkdir -p "$workspace" |
| 375 | |
| 376 | source "$ci_root/utils.sh" |
| 377 | |
| 378 | # SCP is not cloned by default |
| 379 | export clone_scp |
| 380 | export scp_root |
| 381 | if not_upon "$scp_root" && upon "$clone_scp"; then |
| 382 | clone_scp=1 |
| 383 | else |
| 384 | clone_scp=0 |
| 385 | fi |
| 386 | |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 387 | # Enable of code coverage and whether there is a local plugin |
| 388 | if upon "$cc_enable" && not_upon "$cc_path"; then |
| 389 | no_cc_t=1 |
| 390 | else |
| 391 | no_cc_t=0 |
| 392 | fi |
| 393 | |
| 394 | # Use clone_repos.sh to clone and share repositories that aren't local. |
Olivier Deprez | e52d6fc | 2019-12-17 17:48:19 +0100 | [diff] [blame] | 395 | no_tf="$tf_root" no_tftf="$tftf_root" no_spm="$spm_root" no_ci="$ci_root" no_cc="$import_cc" \ |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 396 | bash $minus_x "$ci_root/script/clone_repos.sh" |
| 397 | |
| 398 | set -a |
| 399 | source "$workspace/env" |
| 400 | set +a |
| 401 | |
| 402 | if [ "$local_count" -gt 0 ]; then |
| 403 | # At least one repository is local |
| 404 | serialize_builds=1 |
| 405 | else |
| 406 | dont_clean=0 |
| 407 | fi |
| 408 | |
| 409 | export -f upon not_upon |
| 410 | |
| 411 | # Generate test descriptions |
| 412 | "$ci_root/script/gen_test_desc.py" |
| 413 | |
| 414 | # Iterate through test files in workspace |
| 415 | pushd "$workspace" |
| 416 | |
| 417 | if not_upon "$parallel" || echo "$parallel" | grep -vq "[0-9]"; then |
| 418 | parallel=1 |
| 419 | test_run="$user_test_run" |
| 420 | dont_clean="$user_dont_clean" |
| 421 | primary_live="$user_primary_live" |
| 422 | fi |
| 423 | |
| 424 | if [ "$parallel" -gt 1 ]; then |
| 425 | msg="Running at most $parallel jobs in parallel" |
| 426 | if upon "$serialize_builds"; then |
| 427 | msg+=" (builds serialized)" |
| 428 | fi |
| 429 | msg+="..." |
| 430 | fi |
| 431 | |
| 432 | # Generate Makefile |
| 433 | gen_makefile |
| 434 | |
| 435 | if upon "$msg"; then |
| 436 | echo "$msg" |
| 437 | echo |
| 438 | fi |
| 439 | |
| 440 | keep_going="${user_keep_going:-1}" |
| 441 | if not_upon "$keep_going"; then |
| 442 | keep_going= |
| 443 | fi |
| 444 | |
| 445 | MAKEFLAGS= make -r -j "$parallel" ${keep_going+-k} 5>&1 &>"make.log" |