summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-07-16 13:50:39 +0800
committerOpportunityLiu <[email protected]>2019-07-16 13:50:39 +0800
commit6147d0287aa0fee9862308512fb39e6f10f0bde8 (patch)
treebb4b647bd1cb2bdbe77d9011b948aa577804e581
parent5416165e691abf933a3b045ed53e8592f8a6e836 (diff)
fix log
-rw-r--r--tests/cli/utils/test.lua4
-rw-r--r--tests/plugins/project/test.lua26
2 files changed, 26 insertions, 4 deletions
diff --git a/tests/cli/utils/test.lua b/tests/cli/utils/test.lua
index f06a303a9..e54f5d0e6 100644
--- a/tests/cli/utils/test.lua
+++ b/tests/cli/utils/test.lua
@@ -6,7 +6,7 @@ end
function test_help(t)
import("core.base.task")
- for _, t in ipairs(task.names()) do
- os.execv("xmake", {t, "--help"})
+ for _, taskname in ipairs(task.names()) do
+ os.runv("xmake", {taskname, "--help"})
end
end
diff --git a/tests/plugins/project/test.lua b/tests/plugins/project/test.lua
index b647d52d9..1df87394e 100644
--- a/tests/plugins/project/test.lua
+++ b/tests/plugins/project/test.lua
@@ -28,8 +28,30 @@ function test_vsxmake(t)
os.execv("xmake", {"project", "-k", vstype, "-a", arch})
os.cd(vstype)
-- run msbuild
- os.exec("msbuild /t:show")
- os.exec("msbuild")
+ try
+ {
+ 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
+ }
+ }
environment.leave("toolchains")
-- clean up
os.cd("..")