File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -87,8 +87,12 @@ def _add_dependencies(projects: Set[str]) -> Set[str]:
8787
8888def _compute_projects_to_test (modified_projects : Set [str ], platform : str ) -> Set [str ]:
8989 """Computes the list of projects that should be passed to LLVM_ENABLE_PROJECTS"""
90- projects_to_test = set (modified_projects )
90+ projects_to_test = set ()
9191 for modified_project in modified_projects :
92+ # Skip all projects where we cannot run tests.
93+ if modified_project not in PROJECT_CHECK_TARGETS :
94+ continue
95+ projects_to_test .add (modified_project )
9296 if modified_project not in DEPENDENTS_TO_TEST :
9397 continue
9498 projects_to_test .update (DEPENDENTS_TO_TEST [modified_project ])
Original file line number Diff line number Diff line change @@ -125,6 +125,22 @@ def test_flang(self):
125125 self .assertEqual (env_variables ["runtimes_to_build" ], "" )
126126 self .assertEqual (env_variables ["runtimes_check_targets" ], "" )
127127
128+ def test_invalid_subproject (self ):
129+ env_variables = compute_projects .get_env_variables (
130+ [".ci/compute_projects.py" ], "Linux"
131+ )
132+ self .assertEqual (env_variables ["projects_to_build" ], "" )
133+ self .assertEqual (env_variables ["project_check_targets" ], "" )
134+ self .assertEqual (env_variables ["runtimes_to_build" ], "" )
135+ self .assertEqual (env_variables ["runtimes_check_targets" ], "" )
136+
137+ def test_top_level_file (self ):
138+ env_variables = compute_projects .get_env_variables (["README.md" ], "Linux" )
139+ self .assertEqual (env_variables ["projects_to_build" ], "" )
140+ self .assertEqual (env_variables ["project_check_targets" ], "" )
141+ self .assertEqual (env_variables ["runtimes_to_build" ], "" )
142+ self .assertEqual (env_variables ["runtimes_check_targets" ], "" )
143+
128144
129145if __name__ == "__main__" :
130146 unittest .main ()
You can’t perform that action at this time.
0 commit comments