@@ -38,20 +38,39 @@ set(IGC_LIT_TEST_DEPENDS
38
38
"${IGC_BUILD__PROJ__igc_opt} "
39
39
)
40
40
41
+
42
+ # Note:
43
+ # This command must be consistent with lit.cfg.py in the following points:
44
+ # 1) the path to tests must be consistent with config.test_source_root
45
+ # 2) the suffix must be consistent with config.suffixes
46
+ # The consistency can be achived by calling a process which returns the list of tests.
47
+ file (GLOB_RECURSE _tests "${IGC_TEST_SOURCE_DIR} /*.ll" )
48
+ if (MSVC )
49
+ source_group (TREE "${IGC_TEST_SOURCE_DIR} " PREFIX "tests" FILES ${_tests} )
50
+ endif ()
51
+
41
52
# This will create a target called `check-igc`, which will run all tests from
42
53
# IGC/Compiler/tests directory. The tests will be run on files in the source
43
54
# directory, since they are not modified, there doesn't seem to be any reason
44
55
# for copying them.
45
- add_lit_testsuite (check-igc "Running the IGC LIT tests"
46
- ${IGC_TEST_BINARY_DIR}
47
- DEPENDS ${IGC_LIT_TEST_DEPENDS}
48
- )
56
+ if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.17" )
57
+ igc_add_lit_target (check-igc "${IGC_TEST_BINARY_DIR} " "Running the IGC LIT tests"
58
+ DEPENDS ${IGC_LIT_TEST_DEPENDS} ${_tests}
59
+ SOURCES ${_tests} ${CMAKE_CURRENT_SOURCE_DIR} /lit.cfg.py
60
+ )
61
+ else ()
62
+ add_lit_testsuite (check-igc "Running the IGC LIT tests"
63
+ ${IGC_TEST_BINARY_DIR}
64
+ DEPENDS ${IGC_LIT_TEST_DEPENDS}
65
+ )
66
+ endif ()
49
67
50
68
# Tests should not be excluded from "Build Solution" in VS.
51
69
set_target_properties (check-igc
52
- PROPERTIES
53
- EXCLUDE_FROM_DEFAULT_BUILD OFF
54
- EXCLUDE_FROM_ALL OFF )
70
+ PROPERTIES
71
+ EXCLUDE_FROM_DEFAULT_BUILD OFF
72
+ EXCLUDE_FROM_ALL OFF
73
+ )
55
74
56
75
# Line below is just used to group LIT reated targets in single directory
57
76
# in IDE. This is completely optional.
0 commit comments