Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bzip2 & brotli: Fix tests with ASan #3606

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion packages/b/brotli/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,21 @@ package("brotli")

on_test(function(package)
if not package:is_cross() then
os.vrun("brotli --version")
local envs
if package:is_plat("windows") then
import("core.tool.toolchain")
local msvc = toolchain.load("msvc")
if msvc and msvc:check() then
envs = msvc:runenvs()
end
elseif package:is_plat("mingw") then
import("core.tool.toolchain")
local mingw = toolchain.load("mingw")
if mingw and mingw:check() then
envs = mingw:runenvs()
end
end
os.vrunv("brotli", {"--version"}, {envs = envs})
end
assert(package:check_csnippets([[
void test() {
Expand Down
20 changes: 17 additions & 3 deletions packages/b/bzip2/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,23 @@ package("bzip2")

on_test(function (package)
if not package:is_cross() then
os.vrun("bunzip2 --help")
os.vrun("bzcat --help")
os.vrun("bzip2 --help")
local envs
if package:is_plat("windows") then
import("core.tool.toolchain")
local msvc = toolchain.load("msvc")
if msvc and msvc:check() then
envs = msvc:runenvs()
end
elseif package:is_plat("mingw") then
import("core.tool.toolchain")
local mingw = toolchain.load("mingw")
if mingw and mingw:check() then
envs = mingw:runenvs()
end
end
os.vrunv("bunzip2", {"--help"}, {envs = envs})
os.vrunv("bzcat", {"--help"}, {envs = envs})
os.vrunv("bzip2", {"--help"}, {envs = envs})
end

assert(package:has_cfuncs("BZ2_bzCompressInit", {includes = "bzlib.h"}))
Expand Down
Loading