Lines Matching +full:sysbuild +full:- +full:cmake

1 # SPDX-License-Identifier: Apache-2.0
6 # Script mode initialization (re-run)
8 list(APPEND CMAKE_MODULE_PATH "${ZEPHYR_BASE}/cmake/modules")
11 # Project mode initialization (main CMake invocation)
17 if(SYSBUILD)
24 # - run_suite(<test-1> [<test-2> ...])
27 # at the end, either here or in sysbuild.cmake.
37 if(NOT SYSBUILD)
47 # - assert_equal(<variable> <expected-value>)
49 # - assert_equal(<variable>
50 # IMAGE <image-1> <expected-value-for-image-1>
51 # [IMAGE <image-2> <expected-value-for-image-2> ...]
98 # Test with a local variable not controlled by sysbuild.
100 set(VARIABLE "cmake cache" CACHE INTERNAL "")
103 # CMake cache value has the highest precedence.
105 assert_equal(VARIABLE "cmake cache")
135 set(TESTCASE_VARIABLE "cmake cache" CACHE INTERNAL "")
138 zephyr_get(TESTCASE_VARIABLE SYSBUILD GLOBAL)
140 IMAGE no_sysbuild "cmake cache"
141 # Provided -DTESTCASE_VARIABLE=<...> serves as the
142 # LOCAL sysbuild-defined value for this primary image.
143 IMAGE zephyr_get "sysbuild.main"
144 # Provided -Dzephyr_get_2nd_TESTCASE_VARIABLE=<...> serves as
145 # the LOCAL sysbuild-defined value for this secondary image.
146 IMAGE zephyr_get_2nd "sysbuild.2nd"
147 # Provided -DTESTCASE_VARIABLE=<...> serves as the
148 # GLOBAL sysbuild-defined value for this tertiary image;
150 IMAGE zephyr_get_3rd "sysbuild.main"
156 zephyr_get(TESTCASE_VARIABLE SYSBUILD LOCAL)
159 IMAGE zephyr_get "sysbuild.main"
160 IMAGE zephyr_get_2nd "sysbuild.2nd"
161 # This image has no LOCAL sysbuild-defined value.
175 # This should be equivalent to: zephyr_get(... SYSBUILD GLOBAL)
179 IMAGE zephyr_get "sysbuild.main"
180 IMAGE zephyr_get_2nd "sysbuild.2nd"
181 IMAGE zephyr_get_3rd "sysbuild.main"
187 # Test with a local variable not controlled by sysbuild.
189 set(VARIABLE "cmake cache" CACHE INTERNAL "")
193 assert_equal(VARIABLE "cmake cache;environment;local")
204 set(VARIABLE "cmake cache" CACHE INTERNAL "")
208 assert_equal(VARIABLE "cmake cache;local")
227 zephyr_get(TESTCASE_VARIABLE MERGE SYSBUILD LOCAL)
230 IMAGE zephyr_get "sysbuild.main"
231 IMAGE zephyr_get_2nd "sysbuild.2nd"
232 # This image has no LOCAL sysbuild-defined value.
238 # Add the GLOBAL sysbuild-defined value.
239 zephyr_get(TESTCASE_VARIABLE MERGE SYSBUILD GLOBAL)
243 IMAGE zephyr_get "sysbuild.main"
244 IMAGE zephyr_get_2nd "sysbuild.2nd;sysbuild.main"
245 IMAGE zephyr_get_3rd "sysbuild.main"
250 set(TESTCASE_VARIABLE "cmake cache" CACHE INTERNAL "")
253 zephyr_get(TESTCASE_VARIABLE MERGE SYSBUILD GLOBAL)
255 IMAGE no_sysbuild "cmake cache;environment;local"
256 IMAGE zephyr_get "sysbuild.main;cmake cache;environment;local"
257 IMAGE zephyr_get_2nd "sysbuild.2nd;sysbuild.main;cmake cache;environment;local"
258 IMAGE zephyr_get_3rd "sysbuild.main;cmake cache;environment;local"
262 zephyr_get(TESTCASE_VARIABLE MERGE SYSBUILD LOCAL)
264 IMAGE no_sysbuild "cmake cache;environment"
265 IMAGE zephyr_get "sysbuild.main;cmake cache;environment"
266 IMAGE zephyr_get_2nd "sysbuild.2nd;cmake cache;environment"
267 IMAGE zephyr_get_3rd "cmake cache;environment"
273 # This should be equivalent to: zephyr_get(... SYSBUILD GLOBAL)
277 IMAGE zephyr_get "sysbuild.main;environment"
278 IMAGE zephyr_get_2nd "sysbuild.2nd;sysbuild.main;environment"
279 IMAGE zephyr_get_3rd "sysbuild.main;environment"
286 # Test with local variables not controlled by sysbuild.
295 set(VARIABLE_2 "cmake cache 2" CACHE INTERNAL "")
301 assert_equal(RESULT "cmake cache 2")
303 assert_equal(RESULT "cmake cache 2")
306 set(VARIABLE_1 "cmake cache 1" CACHE INTERNAL "")
308 assert_equal(RESULT "cmake cache 1")
310 assert_equal(RESULT "cmake cache 2")
318 assert_equal(RESULT "cmake cache 1;cmake cache 2;environment 1;environment 3;local 2;local 3")
321 set(RESULT "cmake cache r" CACHE INTERNAL "")
326 assert_equal(RESULT "cmake cache 2;cmake cache 1;environment 3;environment 1;local 3;local 2")
330 …assert_equal(RESULT "cmake cache r;cmake cache 2;cmake cache 1;environment r;environment 3;environ…
334 …assert_equal(RESULT "cmake cache 2;cmake cache 1;cmake cache r;environment 3;environment 1;environ…
361 set(VARIABLE_2 "cmake cache 2" CACHE INTERNAL "")
368 set(TESTCASE_VARIABLE "cmake cache s" CACHE INTERNAL "")
371 zephyr_get(RESULT SYSBUILD GLOBAL VAR TESTCASE_VARIABLE VARIABLE_1 VARIABLE_2 VARIABLE_3)
373 IMAGE no_sysbuild "cmake cache s"
374 IMAGE zephyr_get "sysbuild.main"
375 IMAGE zephyr_get_2nd "sysbuild.2nd"
376 IMAGE zephyr_get_3rd "sysbuild.main"
378 zephyr_get(RESULT SYSBUILD LOCAL VAR TESTCASE_VARIABLE VARIABLE_1 VARIABLE_2 VARIABLE_3)
380 IMAGE no_sysbuild "cmake cache s"
381 IMAGE zephyr_get "sysbuild.main"
382 IMAGE zephyr_get_2nd "sysbuild.2nd"
383 IMAGE zephyr_get_3rd "cmake cache s"
387 zephyr_get(RESULT SYSBUILD GLOBAL MERGE VAR TESTCASE_VARIABLE VARIABLE_1 VARIABLE_2 VARIABLE_3)
389 …IMAGE no_sysbuild "cmake cache s;cmake cache 2;environment s;environment 1;environment 3;local …
390 …IMAGE zephyr_get "sysbuild.main;cmake cache s;cmake cache 2;environment s;environment 1;enviro…
391 …IMAGE zephyr_get_2nd "sysbuild.2nd;sysbuild.main;cmake cache s;cmake cache 2;environment s;environ…
392 …IMAGE zephyr_get_3rd "sysbuild.main;cmake cache s;cmake cache 2;environment s;environment 1;enviro…
395 zephyr_get(RESULT SYSBUILD LOCAL MERGE VAR TESTCASE_VARIABLE VARIABLE_1 VARIABLE_2 VARIABLE_3)
397 …IMAGE no_sysbuild "cmake cache s;cmake cache 2;environment s;environment 1;environment 3;local …
398 …IMAGE zephyr_get "sysbuild.main;cmake cache s;cmake cache 2;environment s;environment 1;enviro…
399 …IMAGE zephyr_get_2nd "sysbuild.2nd;cmake cache s;cmake cache 2;environment s;environment 1;environ…
400 …IMAGE zephyr_get_3rd "cmake cache s;cmake cache 2;environment s;environment 1;environment 3;local …
403 zephyr_get(RESULT SYSBUILD GLOBAL MERGE VAR VARIABLE_3 VARIABLE_2 VARIABLE_1 TESTCASE_VARIABLE)
405 …IMAGE no_sysbuild "cmake cache 2;cmake cache s;environment 3;environment 1;environment s;local …
406 …IMAGE zephyr_get "sysbuild.main;cmake cache 2;cmake cache s;environment 3;environment 1;enviro…
407 …IMAGE zephyr_get_2nd "sysbuild.2nd;sysbuild.main;cmake cache 2;cmake cache s;environment 3;environ…
408 …IMAGE zephyr_get_3rd "sysbuild.main;cmake cache 2;cmake cache s;environment 3;environment 1;enviro…
411 zephyr_get(RESULT SYSBUILD LOCAL MERGE VAR VARIABLE_3 VARIABLE_2 VARIABLE_1 TESTCASE_VARIABLE)
413 …IMAGE no_sysbuild "cmake cache 2;cmake cache s;environment 3;environment 1;environment s;local …
414 …IMAGE zephyr_get "sysbuild.main;cmake cache 2;cmake cache s;environment 3;environment 1;enviro…
415 …IMAGE zephyr_get_2nd "sysbuild.2nd;cmake cache 2;cmake cache s;environment 3;environment 1;environ…
416 …IMAGE zephyr_get_3rd "cmake cache 2;cmake cache s;environment 3;environment 1;environment s;local …
422 # Test with local variables not controlled by sysbuild.
431 set(VARIABLE_1 "cmake cache 1" CACHE INTERNAL "")
432 set(VARIABLE_2 "cmake cache 2" CACHE INTERNAL "")
438 assert_equal(VARIABLE_1 "local 1;environment 1;cmake cache 1")
441 assert_equal(RESULT "local 1;local 2;environment 1;environment 2;cmake cache 1;cmake cache 2")
452 …assert_equal(RESULT "local 1;local 2;F;E;environment 1;environment 2;A;B;C;D;cmake cache 1;cmake c…
459 zephyr_get(TESTCASE_VARIABLE MERGE REVERSE SYSBUILD GLOBAL)
462 IMAGE zephyr_get "sysbuild.main"
463 IMAGE zephyr_get_2nd "sysbuild.main;sysbuild.2nd"
464 IMAGE zephyr_get_3rd "sysbuild.main"
469 set(TESTCASE_VARIABLE "cmake cache s" CACHE INTERNAL "")
472 zephyr_get(TESTCASE_VARIABLE MERGE REVERSE SYSBUILD GLOBAL)
474 IMAGE no_sysbuild "local s;environment s;cmake cache s"
475 IMAGE zephyr_get "local s;environment s;cmake cache s;sysbuild.main"
476 IMAGE zephyr_get_2nd "local s;environment s;cmake cache s;sysbuild.main;sysbuild.2nd"
477 IMAGE zephyr_get_3rd "local s;environment s;cmake cache s;sysbuild.main"
481 zephyr_get(TESTCASE_VARIABLE MERGE REVERSE SYSBUILD LOCAL)
483 IMAGE no_sysbuild "environment s;cmake cache s"
484 IMAGE zephyr_get "environment s;cmake cache s;sysbuild.main"
485 IMAGE zephyr_get_2nd "environment s;cmake cache s;sysbuild.2nd"
486 IMAGE zephyr_get_3rd "environment s;cmake cache s"
492 # This should be equivalent to: zephyr_get(... SYSBUILD GLOBAL)
495 …s;local 1;local 2;environment s;environment 1;environment 2;cmake cache s;cmake cache 1;cmake cach…
496 …;local 2;environment s;environment 1;environment 2;cmake cache s;cmake cache 1;cmake cache 2;sysbu…
497 …2;environment s;environment 1;environment 2;cmake cache s;cmake cache 1;cmake cache 2;sysbuild.mai…
498 …;local 2;environment s;environment 1;environment 2;cmake cache s;cmake cache 1;cmake cache 2;sysbu…
522 set(VARIABLE_2 "cmake cache 2" CACHE INTERNAL "")
523 set(VARIABLE_3 "cmake cache 3" CACHE INTERNAL "")
525 # Snippets have higher precedence than environment, but lower than CMake cache.
533 assert_equal(VARIABLE_2 "cmake cache 2")
536 assert_equal(VARIABLE_2 "cmake cache 2;snippet 2;local 2")
539 assert_equal(VARIABLE_3 "cmake cache 3")
542 assert_equal(VARIABLE_3 "cmake cache 3;snippet 3;environment 3;local 3")
549 …l 2;local 3;environment 1;environment 3;snippet 1;snippet 2;snippet 3;cmake cache 2;cmake cache 3")
551 # Transitively, snippets have lower precedence than sysbuild-defined values.
555 IMAGE zephyr_get "sysbuild.main"
556 IMAGE zephyr_get_2nd "sysbuild.2nd"
557 IMAGE zephyr_get_3rd "sysbuild.main"
559 zephyr_get(TESTCASE_VARIABLE SYSBUILD LOCAL)
562 IMAGE zephyr_get "sysbuild.main"
563 IMAGE zephyr_get_2nd "sysbuild.2nd"
567 zephyr_get(TESTCASE_VARIABLE MERGE SYSBUILD GLOBAL)
570 IMAGE zephyr_get "sysbuild.main;snippet s"
571 IMAGE zephyr_get_2nd "sysbuild.2nd;sysbuild.main;snippet s"
572 IMAGE zephyr_get_3rd "sysbuild.main;snippet s"
599 if (NOT CMAKE_SCRIPT_MODE_FILE AND NOT SYSBUILD)
600 # Re-run this testsuite in plain script mode
601 execute_process(COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_LIST_FILE})