Skip to content

Commit 15008cd

Browse files
committed
Add a Valgrind builder + factory with a selected set of tests
Signed-off-by: Pablo Galindo <[email protected]>
1 parent 5673458 commit 15008cd

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

master/custom/builders.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
Wasm32WasiDebugBuild,
4848
IOSARM64SimulatorBuild,
4949
AndroidBuild,
50+
ValgrindBuild,
5051
)
5152

5253
# A builder can be marked as stable when at least the 10 latest builds are
@@ -219,6 +220,8 @@
219220
("AMD64 CentOS9 LTO + PGO", "cstratak-CentOS9-x86_64", LTOPGONonDebugBuild),
220221
("AMD64 CentOS9 FIPS Only Blake2 Builtin Hash", "cstratak-CentOS9-fips-x86_64", CentOS9NoBuiltinHashesUnixBuildExceptBlake2),
221222
("AMD64 CentOS9 FIPS No Builtin Hashes", "cstratak-CentOS9-fips-x86_64", CentOS9NoBuiltinHashesUnixBuild),
223+
224+
("AMD64 Arch Linux Valgrind", "pablogsal-arch-x86_64", ValgrindBuild),
222225
]
223226

224227

@@ -347,4 +350,5 @@ def get_builders(settings):
347350
"Cygwin",
348351
"ARM64 Windows",
349352
"AMD64 Arch Linux Perf",
353+
"AMD64 Arch Linux Valgrind",
350354
)

master/custom/factories.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,3 +1219,68 @@ def setup(self, **kwargs):
12191219
def host_triple(props):
12201220
build_triple = props.getProperty("build_triple")
12211221
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_tokenize",
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=$(PWD)/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

Comments
 (0)