summaryrefslogtreecommitdiff
path: root/tests/projects/c/llvm_compiler_rt/test.lua
blob: 6285ecb1a614eebd270df9f12f6c76015b301d4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import("lib.detect.find_tool")
import("core.tool.toolchain")
import("utils.ci.is_running", {alias = "ci_is_running"})

function run_test(toolchain_name)
    local flags = ""
    if ci_is_running() then
        flags = "-vD"
    end

    local plat = os.host()
    local arch = os.arch()
    if is_subhost("msys") then
        plat = "mingw"
    end
    local toolchain_inst = toolchain.load(toolchain_name, {plat = plat, arch = arch})
    if not toolchain_inst or not toolchain_inst:check() then
        wprint(toolchain_name .. " not found, skipping tests")
        return
    end
    os.exec("xmake clean -a")
    os.exec("xmake f --toolchain=" .. toolchain_name .. " -c --yes " .. flags)
    os.run("xmake -r " .. flags)
end

function main(t)
    run_test("llvm")
    run_test("clang")
end