@@ -93,10 +93,14 @@ class PrCfg:
93
93
# Max number of extensive tests to run by default
94
94
MANY_EXTENSIVE_THRESHOLD : int = 20
95
95
96
+ # Run tests for `libm` that may otherwise be skipped due to no changed files.
97
+ always_test_libm : bool = False
98
+
96
99
# String values of directive names
97
100
DIR_ALLOW_REGRESSIONS : str = "allow-regressions"
98
101
DIR_SKIP_EXTENSIVE : str = "skip-extensive"
99
102
DIR_ALLOW_MANY_EXTENSIVE : str = "allow-many-extensive"
103
+ DIR_TEST_LIBM : str = "test-libm"
100
104
101
105
def __init__ (self , body : str ):
102
106
directives = re .finditer (r"^\s*ci:\s*(?P<dir_name>\S*)" , body , re .MULTILINE )
@@ -108,6 +112,8 @@ def __init__(self, body: str):
108
112
self .skip_extensive = True
109
113
elif name == self .DIR_ALLOW_MANY_EXTENSIVE :
110
114
self .allow_many_extensive = True
115
+ elif name == self .DIR_TEST_LIBM :
116
+ self .always_test_libm = True
111
117
else :
112
118
eprint (f"Found unexpected directive `{ name } `" )
113
119
exit (1 )
@@ -253,6 +259,13 @@ def may_skip_libm_ci(self) -> bool:
253
259
if not self .is_pr ():
254
260
return False
255
261
262
+ pr = PrInfo .from_env ()
263
+ assert pr is not None , "Is a PR but couldn't load PrInfo"
264
+
265
+ # Allow opting in to libm tests
266
+ if pr .cfg .always_test_libm :
267
+ return False
268
+
256
269
# By default, run if there are any changed files matching the pattern
257
270
return all (not re .match (TRIGGER_LIBM_CI_FILE_PAT , str (f )) for f in self .changed )
258
271
0 commit comments