5151 "bolt" , # No Windows Support.
5252}
5353
54+ EXCLUDE_MAC = {
55+ "bolt" ,
56+ "compiler-rt" ,
57+ "cross-project-tests" ,
58+ "flang" ,
59+ "libc" ,
60+ "libcxx" ,
61+ "libcxxabi" ,
62+ "libunwind" ,
63+ "lldb" ,
64+ "openmp" ,
65+ "polly" ,
66+ }
67+
5468PROJECT_CHECK_TARGETS = {
5569 "clang-tools-extra" : "check-clang-tools" ,
5670 "compiler-rt" : "check-compiler-rt" ,
@@ -86,7 +100,6 @@ def _add_dependencies(projects: Set[str]) -> Set[str]:
86100
87101
88102def _compute_projects_to_test (modified_projects : Set [str ], platform : str ) -> Set [str ]:
89- """Computes the list of projects that should be passed to LLVM_ENABLE_PROJECTS"""
90103 projects_to_test = set ()
91104 for modified_project in modified_projects :
92105 # Skip all projects where we cannot run tests.
@@ -104,6 +117,10 @@ def _compute_projects_to_test(modified_projects: Set[str], platform: str) -> Set
104117 for to_exclude in EXCLUDE_WINDOWS :
105118 if to_exclude in projects_to_test :
106119 projects_to_test .remove (to_exclude )
120+ elif platform == "Darwin" :
121+ for to_exclude in EXCLUDE_MAC :
122+ if to_exclude in projects_to_test :
123+ projects_to_test .remove (to_exclude )
107124 else :
108125 raise ValueError ("Unexpected platform." )
109126 return projects_to_test
@@ -114,7 +131,6 @@ def _compute_projects_to_build(projects_to_test: Set[str]) -> Set[str]:
114131
115132
116133def _compute_project_check_targets (projects_to_test : Set [str ]) -> Set [str ]:
117- """blah blah blah"""
118134 check_targets = set ()
119135 for project_to_test in projects_to_test :
120136 if project_to_test not in PROJECT_CHECK_TARGETS :
@@ -124,7 +140,6 @@ def _compute_project_check_targets(projects_to_test: Set[str]) -> Set[str]:
124140
125141
126142def _compute_runtimes_to_test (projects_to_test : Set [str ]) -> Set [str ]:
127- """blah blah blah"""
128143 runtimes_to_test = set ()
129144 for project_to_test in projects_to_test :
130145 if project_to_test not in DEPENDENT_RUNTIMES_TO_TEST :
@@ -134,15 +149,13 @@ def _compute_runtimes_to_test(projects_to_test: Set[str]) -> Set[str]:
134149
135150
136151def _compute_runtime_check_targets (runtimes_to_test : Set [str ]) -> Set [str ]:
137- """blah blah blah"""
138152 check_targets = set ()
139153 for runtime_to_test in runtimes_to_test :
140154 check_targets .add (PROJECT_CHECK_TARGETS [runtime_to_test ])
141155 return check_targets
142156
143157
144158def _get_modified_projects (modified_files : list [str ]) -> Set [str ]:
145- """blah blah blah"""
146159 modified_projects = set ()
147160 for modified_file in modified_files :
148161 modified_projects .add (pathlib .Path (modified_file ).parts [0 ])
@@ -165,6 +178,9 @@ def get_env_variables(modified_files: list[str], platform: str) -> Set[str]:
165178
166179
167180if __name__ == "__main__" :
168- env_variables = get_env_variables (sys .stdin .readlines (), platform .system ())
181+ current_platform = platform .system ()
182+ if len (sys .argv ) == 2 :
183+ current_platform = sys .argv [1 ]
184+ env_variables = get_env_variables (sys .stdin .readlines (), current_platform )
169185 for env_variable in env_variables :
170- print (f"{ env_variable } ={ env_variables [env_variable ]} " )
186+ print (f"{ env_variable } =\" { env_variables [env_variable ]} \" " )
0 commit comments