mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-25 00:23:33 +03:00
feat: enable prof integration tests
Refactor prof flag test changes and handle source inclusion. This enables prof tests for all integration tests.
This commit is contained in:
parent
48e68dfc84
commit
8b561971c4
5 changed files with 195 additions and 38 deletions
37
tools/test.bzl
Normal file
37
tools/test.bzl
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
"Various test related utility functions"
|
||||
|
||||
def join_conf(conf1, conf2):
|
||||
"""Joins two configuration strings with a ',' delimiter.
|
||||
|
||||
Args:
|
||||
conf1: First configuration string or None
|
||||
conf2: Second configuration string or None
|
||||
|
||||
Returns:
|
||||
A properly joined configuration string without dangling commas.
|
||||
"""
|
||||
|
||||
if conf1 and conf2:
|
||||
return "%s,%s" % (conf1, conf2)
|
||||
elif not conf1:
|
||||
return conf2
|
||||
elif not conf2:
|
||||
return conf1
|
||||
else:
|
||||
return ""
|
||||
|
||||
def test_name(data, suffix = None):
|
||||
"""Generates a test name based on the source file name.
|
||||
|
||||
Args:
|
||||
data: Dict with test data containing 'src' and optional 'name' key
|
||||
suffix: String suffix to remove from the source file name
|
||||
|
||||
Returns:
|
||||
A string representing the test name.
|
||||
"""
|
||||
name = data.get("name", data["src"].lower().removesuffix(".c").removesuffix(".cpp").replace("/", "_"))
|
||||
if suffix:
|
||||
return "%s_%s" % (name, suffix)
|
||||
else:
|
||||
return name
|
||||
Loading…
Add table
Add a link
Reference in a new issue