diff options
| author | OpportunityLiu <[email protected]> | 2019-07-16 13:52:19 +0800 |
|---|---|---|
| committer | OpportunityLiu <[email protected]> | 2019-07-16 13:52:19 +0800 |
| commit | c8b3a2ec036c524dfec06f5e7416a3fd27c6f8a1 (patch) | |
| tree | df8cf55a5416ce213fa6f7693efe80bdc3bf61f0 /tests/plugins/project/test.lua | |
| parent | 6147d0287aa0fee9862308512fb39e6f10f0bde8 (diff) | |
only 2010~
Diffstat (limited to 'tests/plugins/project/test.lua')
| -rw-r--r-- | tests/plugins/project/test.lua | 74 |
1 files changed, 38 insertions, 36 deletions
diff --git a/tests/plugins/project/test.lua b/tests/plugins/project/test.lua index 1df87394e..9ee9866c8 100644 --- a/tests/plugins/project/test.lua +++ b/tests/plugins/project/test.lua @@ -16,46 +16,48 @@ function test_vsxmake(t) os.cd("c") for name, _ in pairs(vs) do - -- set config - config.set("arch", arch) - config.set("vs", name) - config.check() - platform.load(config.plat()) - environment.enter("toolchains") + if tonumber(vs) >= 2010 then + -- set config + config.set("arch", arch) + config.set("vs", name) + config.check() + platform.load(config.plat()) + environment.enter("toolchains") - local vstype = "vsxmake" .. name - -- create sln & vcxproj - os.execv("xmake", {"project", "-k", vstype, "-a", arch}) - os.cd(vstype) - -- run msbuild - try - { - function () - return os.iorun("msbuild /P:XmakeDiagnosis=true /P:XmakeVerbose=true") - end, - finally + local vstype = "vsxmake" .. name + -- create sln & vcxproj + os.execv("xmake", {"project", "-k", vstype, "-a", arch}) + os.cd(vstype) + -- run msbuild + try { - function (ok, stdout, stderr) - if ok then - return + function () + return os.iorun("msbuild /P:XmakeDiagnosis=true /P:XmakeVerbose=true") + end, + finally + { + function (ok, stdout, stderr) + if ok then + return + end + print("run msbuild for %s", vstype) + io.write("--- msbuild output ---") + io.write(stdout, "\n", stderr) + io.write("--- sln file ---") + io.write(io.readfile("c_" .. vstype .. ".sln"), "\n") + io.write("--- vcx file ---") + io.write(io.readfile("project/project.vcxproj"), "\n") + io.write("--- filter file ---") + io.write(io.readfile("project/project.vcxprok.filters"), "\n") + raise("msbuild failed") end - print("run msbuild for %s", vstype) - io.write("--- msbuild output ---") - io.write(stdout, "\n", stderr) - io.write("--- sln file ---") - io.write(io.readfile("c_" .. vstype .. ".sln"), "\n") - io.write("--- vcx file ---") - io.write(io.readfile("project/project.vcxproj"), "\n") - io.write("--- filter file ---") - io.write(io.readfile("project/project.vcxprok.filters"), "\n") - raise("msbuild failed") - end + } } - } - environment.leave("toolchains") - -- clean up - os.cd("..") - os.tryrm(vstype) + environment.leave("toolchains") + -- clean up + os.cd("..") + os.tryrm(vstype) + end end os.cd("..") |
