diff options
| author | ruki <[email protected]> | 2026-04-08 09:26:51 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-04-08 09:26:51 +0800 |
| commit | eca58b56da3eea930c78af913fc15c7607a32d0a (patch) | |
| tree | 530cf7a25237f9ea8278d5bef22f6dbcacf6e62c /tests/projects/c++/modules | |
| parent | fb5f06400b4340dd759fe6e458da50fc89351a2f (diff) | |
Update test.lua
Diffstat (limited to 'tests/projects/c++/modules')
| -rw-r--r-- | tests/projects/c++/modules/reuse_strict_private_defines/test.lua | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/tests/projects/c++/modules/reuse_strict_private_defines/test.lua b/tests/projects/c++/modules/reuse_strict_private_defines/test.lua index 4405d6e47..aeaf2cf10 100644 --- a/tests/projects/c++/modules/reuse_strict_private_defines/test.lua +++ b/tests/projects/c++/modules/reuse_strict_private_defines/test.lua @@ -13,26 +13,30 @@ function _build() if ci_is_running() then flags = "-vD" end - local outdata = os.iorun("xmake -r " .. flags) local leaked = false local missing_sysincludedir = true - for line in outdata:gmatch("[^\r\n]+") do - if line:find("Consumer", 1, true) then - if line:find(PRIVATE_DEFINE, 1, true) then - leaked = true - end - if line:find(PUBLIC_SYSINCLUDEDIR, 1, true) then - missing_sysincludedir = false + local outdata = try { function () return os.iorun("xmake -rv") end } + if outdata then + for line in outdata:gmatch("[^\r\n]+") do + if line:find("Consumer", 1, true) then + if line:find(PRIVATE_DEFINE, 1, true) then + leaked = true + end + if line:find(PUBLIC_SYSINCLUDEDIR, 1, true) then + missing_sysincludedir = false + end end end + if leaked then + raise("Private dependency defines leaked into Consumer module rebuilds under reuse.strict\n%s", outdata) + end + if missing_sysincludedir then + raise("Missing public sysincludedir in Consumer module rebuilds under reuse.strict\n%s", outdata) + end + else + -- maybe build failed, we need to see verbose errors + os.run("xmake " .. flags) end - if leaked then - raise("Private dependency defines leaked into Consumer module rebuilds under reuse.strict\n%s", outdata) - end - if missing_sysincludedir then - raise("Missing public sysincludedir in Consumer module rebuilds under reuse.strict\n%s", outdata) - end - os.run("xmake " .. flags) end function main(_) |
