@@ -1219,3 +1219,68 @@ def setup(self, **kwargs):
1219
1219
def host_triple (props ):
1220
1220
build_triple = props .getProperty ("build_triple" )
1221
1221
return build_triple .split ("-" )[0 ] + "-linux-android"
1222
+
1223
+
1224
+ class ValgrindBuild (UnixBuild ):
1225
+ buildersuffix = ".valgrind"
1226
+ configureFlags = [
1227
+ "--with-pydebug" ,
1228
+ "--with-valgrind" ,
1229
+ "--without-pymalloc" ,
1230
+ ]
1231
+ testFlags = [
1232
+ "test_grammar" ,
1233
+ "test_syntax" ,
1234
+ "test_tokenizer" ,
1235
+ "test_fstring" ,
1236
+ "test_ast" ,
1237
+ "test_exceptions" ,
1238
+ ]
1239
+ factory_tags = ["valgrind" ]
1240
+ test_timeout = TEST_TIMEOUT * 5
1241
+
1242
+ def setup (self , parallel , branch , ** kwargs ):
1243
+ self .addStep (
1244
+ Configure (
1245
+ command = ["./configure" , "--prefix" , "$(PWD)/target" ] + self .configureFlags
1246
+ )
1247
+ )
1248
+
1249
+ compile = ["make" , self .makeTarget ]
1250
+ if parallel :
1251
+ compile = ["make" , parallel , self .makeTarget ]
1252
+
1253
+ self .addStep (Compile (command = compile , env = self .compile_environ ))
1254
+
1255
+ self .addStep (
1256
+ ShellCommand (
1257
+ name = "pythoninfo" ,
1258
+ description = "pythoninfo" ,
1259
+ command = ["make" , "pythoninfo" ],
1260
+ warnOnFailure = True ,
1261
+ env = self .test_environ ,
1262
+ )
1263
+ )
1264
+
1265
+ test = [
1266
+ "valgrind" ,
1267
+ "--leak-check=full" ,
1268
+ "--show-leak-kinds=definite" ,
1269
+ "--error-exitcode=1" ,
1270
+ "--gen-suppressions=all" ,
1271
+ "--track-origins=yes" ,
1272
+ "--trace-children=yes" ,
1273
+ "--suppressions=Misc/valgrind-python.supp" ,
1274
+ "./python" ,
1275
+ "-m" , "test" ,
1276
+ * self .testFlags ,
1277
+ f"--timeout={ self .test_timeout } " ,
1278
+ ]
1279
+
1280
+ self .addStep (Test (
1281
+ command = test ,
1282
+ timeout = step_timeout (self .test_timeout ),
1283
+ env = self .test_environ ,
1284
+ ))
1285
+
1286
+ self .addStep (Clean ())
0 commit comments