aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2026-03-17 13:56:50 +0100
committerGitHub Enterprise <[email protected]>2026-03-17 13:56:50 +0100
commit90ca5315b2745fde3ccf9ce9d7106537cae566c8 (patch)
tree4f44464225dc8c8e8386f428b31697971e0f0a2f /scripts
parentrevise oplog block arrangement (#842) (diff)
downloadzen-90ca5315b2745fde3ccf9ce9d7106537cae566c8.tar.xz
zen-90ca5315b2745fde3ccf9ce9d7106537cae566c8.zip
add sanitizer options to xmake (#847)v5.7.23-pre1v5.7.23-pre0
- Improvement: Add easy access options for sanitizers with `xmake config` and `xmake test` as options - `--msan=[y|n]` Enable MemorySanitizer (Linux only, requires all deps instrumented) - `--asan=[y|n]` Enable AddressSanitizer (disables mimalloc and sentry) - `--tsan=[y|n]` Enable ThreadSanitizer (Linux/Mac only)
Diffstat (limited to 'scripts')
-rw-r--r--scripts/test.lua17
1 files changed, 14 insertions, 3 deletions
diff --git a/scripts/test.lua b/scripts/test.lua
index df1218ce8..3c18225fb 100644
--- a/scripts/test.lua
+++ b/scripts/test.lua
@@ -86,11 +86,22 @@ function main()
arch = "x86_64"
end
+ local want_asan = option.get("asan") == true
+ local have_asan = config.get("asan") == true
+ local want_tsan = option.get("tsan") == true
+ local have_tsan = config.get("tsan") == true
+ local want_msan = option.get("msan") == true
+ local have_msan = config.get("msan") == true
+
-- Only reconfigure if current config doesn't already match
- if config.get("mode") ~= "debug" or config.get("plat") ~= plat or config.get("arch") ~= arch then
+ if config.get("mode") ~= "debug" or config.get("plat") ~= plat or config.get("arch") ~= arch
+ or want_asan ~= have_asan or want_tsan ~= have_tsan or want_msan ~= have_msan then
local toolchain_flag = config.get("toolchain") and ("--toolchain=" .. config.get("toolchain")) or ""
local sdk_flag = config.get("sdk") and ("--sdk=" .. config.get("sdk")) or ""
- os.exec("xmake config -y -c -m debug -p %s -a %s %s %s", plat, arch, toolchain_flag, sdk_flag)
+ local asan_flag = want_asan and "--asan=y" or ""
+ local tsan_flag = want_tsan and "--tsan=y" or ""
+ local msan_flag = want_msan and "--msan=y" or ""
+ os.exec("xmake config -y -c -m debug -p %s -a %s %s %s %s %s %s", plat, arch, toolchain_flag, sdk_flag, asan_flag, tsan_flag, msan_flag)
end
-- Build targets we're going to run
@@ -104,7 +115,7 @@ function main()
local use_junit_reporting = option.get("junit")
local use_noskip = option.get("noskip")
- local use_verbose = option.get("verbose")
+ local use_verbose = option.get("output")
local repeat_count = tonumber(option.get("repeat")) or 1
local extra_args = option.get("arguments") or {}
local junit_report_files = {}