Skip to content

Commit a4af3e6

Browse files
krystian-andrzejewskiigcbot
authored andcommitted
Do not run unit level test if impossible
Unit level tests use IGC tools which do not have to be built. Such situations must be handled by Cmake files.
1 parent 9752443 commit a4af3e6

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

IGC/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,9 +1904,8 @@ endif()
19041904

19051905
# ============================================== LIT TESTS =============================================
19061906

1907-
add_subdirectory(Compiler/tests)
1908-
if(TARGET "check-igc")
1909-
add_dependencies("${IGC_BUILD__PROJ__igc_dll}" "check-igc")
1907+
if(DEFINED IGC_BUILD__PROJ__igc_opt AND TARGET ${IGC_BUILD__PROJ__igc_opt})
1908+
add_subdirectory(Compiler/tests)
19101909
endif()
19111910

19121911

IGC/Compiler/tests/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ set(IGC_LIT_TEST_DEPENDS
3535
FileCheck
3636
count
3737
not
38-
igc_opt
38+
"${IGC_BUILD__PROJ__igc_opt}"
3939
)
4040

4141
# This will create a target called `check-igc`, which will run all tests from
@@ -48,7 +48,10 @@ add_lit_testsuite(check-igc "Running the IGC LIT tests"
4848
)
4949

5050
# Tests should not be excluded from "Build Solution" in VS.
51-
set_target_properties(check-igc PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD OFF)
51+
set_target_properties(check-igc
52+
PROPERTIES
53+
EXCLUDE_FROM_DEFAULT_BUILD OFF
54+
EXCLUDE_FROM_ALL OFF)
5255

5356
# Line below is just used to group LIT reated targets in single directory
5457
# in IDE. This is completely optional.

0 commit comments

Comments
 (0)