diff options
| author | Saikari <[email protected]> | 2026-04-03 00:19:12 +0300 |
|---|---|---|
| committer | Saikari <[email protected]> | 2026-04-03 00:19:12 +0300 |
| commit | 75e1604e1fd44459a6169b1fcb8c1fd06599feef (patch) | |
| tree | f0b7e82d161cfeb9b8f98f6d2c507436de513ac0 | |
| parent | c9ceb0483382a858e17f90cc4bbcf4833cedf6cd (diff) | |
refactor safety test to remove dependency on find_tool and streamline package installation
| -rw-r--r-- | tests/projects/c/filc/safety_test/test.lua | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/tests/projects/c/filc/safety_test/test.lua b/tests/projects/c/filc/safety_test/test.lua index 34d462e7b..2a372b3cd 100644 --- a/tests/projects/c/filc/safety_test/test.lua +++ b/tests/projects/c/filc/safety_test/test.lua @@ -1,4 +1,3 @@ -import("lib.detect.find_tool") import("utils.ci.is_running", {alias = "ci_is_running"}) function main(t) @@ -7,14 +6,21 @@ function main(t) return t:skip("filc is only supported on linux/x86_64") end - local filcc = find_tool("filcc") - if not filcc then - return t:skip("filcc not found, please install the filc package first") + local flags = ci_is_running() and "-vD" or "" + + -- configure and install the filc package; skip if unavailable + local configured = try + { + function () + os.exec("xmake f -c -y " .. flags) + return true + end, + catch { function () end } + } + if not configured then + return t:skip("filc package not available or install failed") end - -- build the safety test - local flags = ci_is_running() and "-vD" or "" - os.exec("xmake f -c -y " .. flags) os.exec("xmake -r " .. flags) -- find the compiled binary |
