@@ -19,6 +19,11 @@ function(get_object_files_for_test result skipped_entrypoints_list internal_obj)
19
19
set (skipped_list "" )
20
20
set (checked_list "" )
21
21
set (unchecked_list "${ARGN} " )
22
+
23
+ set (check_obj_for_tests "CHECK_OBJ_FOR_TESTS_${internal_obj} " )
24
+ set (object_files_for_tests "OBJECT_FILES_FOR_TESTS_${internal_obj} " )
25
+ set (skipped_list_for_tests "SKIPPED_LIST_FOR_TESTS_${internal_obj} " )
26
+
22
27
list (REMOVE_DUPLICATES unchecked_list )
23
28
24
29
foreach (dep IN LISTS unchecked_list )
@@ -39,12 +44,12 @@ function(get_object_files_for_test result skipped_entrypoints_list internal_obj)
39
44
continue ()
40
45
endif ()
41
46
42
- get_target_property (dep_checked ${dep} "CHECK_OBJ_FOR_TESTS" )
47
+ get_target_property (dep_checked ${dep} ${check_obj_for_tests} )
43
48
44
49
if (dep_checked )
45
50
# Target full dependency has already been checked. Just use the results.
46
- get_target_property (dep_obj ${dep} "OBJECT_FILES_FOR_TESTS" )
47
- get_target_property (dep_skip ${dep} "SKIPPED_LIST_FOR_TESTS" )
51
+ get_target_property (dep_obj ${dep} ${object_files_for_tests} )
52
+ get_target_property (dep_skip ${dep} ${skipped_list_for_tests} )
48
53
else ()
49
54
# Target full dependency hasn't been checked. Recursively check its DEPS.
50
55
set (dep_obj "${dep} " )
@@ -79,9 +84,9 @@ function(get_object_files_for_test result skipped_entrypoints_list internal_obj)
79
84
endif ()
80
85
81
86
set_target_properties (${dep} PROPERTIES
82
- OBJECT_FILES_FOR_TESTS "${dep_obj} "
83
- SKIPPED_LIST_FOR_TESTS "${dep_skip} "
84
- CHECK_OBJ_FOR_TESTS "YES"
87
+ " ${object_files_for_tests} " "${dep_obj} "
88
+ " ${skipped_list_for_tests} " "${dep_skip} "
89
+ " ${check_obj_for_tests} " "YES"
85
90
)
86
91
87
92
endif ()
@@ -173,6 +178,15 @@ function(create_libc_unittest fq_target_name)
173
178
return ()
174
179
endif ()
175
180
181
+ if (SHOW_INTERMEDIATE_OBJECTS )
182
+ message (STATUS "Adding unit test ${fq_target_name} " )
183
+ if (${SHOW_INTERMEDIATE_OBJECTS} STREQUAL "DEPS" )
184
+ foreach (dep IN LISTS LIBC_UNITTEST_DEPENDS )
185
+ message (STATUS " ${fq_target_name} depends on ${dep} " )
186
+ endforeach ()
187
+ endif ()
188
+ endif ()
189
+
176
190
if (LIBC_UNITTEST_NO_RUN_POSTBUILD )
177
191
set (fq_build_target_name ${fq_target_name} )
178
192
else ()
@@ -499,13 +513,24 @@ function(add_integration_test test_name)
499
513
get_fq_target_name (${test_name} .libc fq_libc_target_name )
500
514
501
515
get_fq_deps_list (fq_deps_list ${INTEGRATION_TEST_DEPENDS} )
516
+
517
+ if (SHOW_INTERMEDIATE_OBJECTS )
518
+ message (STATUS "Adding integration test ${fq_target_name} " )
519
+ if (${SHOW_INTERMEDIATE_OBJECTS} STREQUAL "DEPS" )
520
+ foreach (dep IN LISTS fq_deps_list )
521
+ message (STATUS " ${fq_target_name} depends on ${dep} " )
522
+ endforeach ()
523
+ endif ()
524
+ endif ()
525
+
502
526
list (APPEND fq_deps_list
503
527
# All integration tests use the operating system's startup object with the
504
528
# integration test object and need to inherit the same dependencies.
505
529
libc.startup.${LIBC_TARGET_OS}.crt1
506
530
libc.test.IntegrationTest.test
507
531
# We always add the memory functions objects. This is because the
508
532
# compiler's codegen can emit calls to the C memory functions.
533
+ libc.src.stdlib.atexit
509
534
libc.src.string.bcmp
510
535
libc.src.string.bzero
511
536
libc.src.string.memcmp
@@ -526,6 +551,16 @@ function(add_integration_test test_name)
526
551
# collect the object files with public names of entrypoints.
527
552
get_object_files_for_test (
528
553
link_object_files skipped_entrypoints_list FALSE ${fq_deps_list} )
554
+
555
+ if (SHOW_INTERMEDIATE_OBJECTS )
556
+ message (STATUS "Get objects for test ${fq_target_name} " )
557
+ if (${SHOW_INTERMEDIATE_OBJECTS} STREQUAL "DEPS" )
558
+ foreach (dep IN LISTS link_object_files )
559
+ message (STATUS " ${fq_target_name} need object ${dep} " )
560
+ endforeach ()
561
+ endif ()
562
+ endif ()
563
+
529
564
if (skipped_entrypoints_list )
530
565
if (LIBC_CMAKE_VERBOSE_LOGGING )
531
566
set (msg "Skipping integration test ${fq_target_name} as it has missing deps: "
@@ -678,6 +713,16 @@ function(add_libc_hermetic_test test_name)
678
713
get_fq_target_name (${test_name} .libc fq_libc_target_name )
679
714
680
715
get_fq_deps_list (fq_deps_list ${HERMETIC_TEST_DEPENDS} )
716
+
717
+ if (SHOW_INTERMEDIATE_OBJECTS )
718
+ message (STATUS "Adding hermetic test ${fq_target_name} " )
719
+ if (${SHOW_INTERMEDIATE_OBJECTS} STREQUAL "DEPS" )
720
+ foreach (dep IN LISTS fq_deps_list )
721
+ message (STATUS " ${fq_target_name} depends on ${dep} " )
722
+ endforeach ()
723
+ endif ()
724
+ endif ()
725
+
681
726
list (APPEND fq_deps_list
682
727
# Hermetic tests use the platform's startup object. So, their deps also
683
728
# have to be collected.
@@ -710,7 +755,17 @@ function(add_libc_hermetic_test test_name)
710
755
# collect the object files with public names of entrypoints.
711
756
get_object_files_for_test (
712
757
link_object_files skipped_entrypoints_list FALSE ${fq_deps_list} )
713
- if (skipped_entrypoints_list )
758
+
759
+ if (SHOW_INTERMEDIATE_OBJECTS )
760
+ message (STATUS "Get objects for test ${fq_target_name} " )
761
+ if (${SHOW_INTERMEDIATE_OBJECTS} STREQUAL "DEPS" )
762
+ foreach (dep IN LISTS link_object_files )
763
+ message (STATUS " ${fq_target_name} need object ${dep} " )
764
+ endforeach ()
765
+ endif ()
766
+ endif ()
767
+
768
+ if (skipped_entrypoints_list )
714
769
set (msg "Skipping hermetic test ${fq_target_name} as it has missing deps: "
715
770
"${skipped_entrypoints_list} ." )
716
771
message (STATUS ${msg} )
0 commit comments