summaryrefslogtreecommitdiff
path: root/tests/plugins/project/test.lua
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-07-16 12:36:01 +0800
committerOpportunityLiu <[email protected]>2019-07-16 12:36:01 +0800
commitc63d5c42136e92ad16eb81cc1b01db34d29792d1 (patch)
tree173c276d22a9de46b8b491a28092969e43db27bc /tests/plugins/project/test.lua
parent1ab3e1b602a12a95d91433e8b91c2aec8146940f (diff)
add ut
Diffstat (limited to 'tests/plugins/project/test.lua')
-rw-r--r--tests/plugins/project/test.lua33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/plugins/project/test.lua b/tests/plugins/project/test.lua
new file mode 100644
index 000000000..a9f1fa37e
--- /dev/null
+++ b/tests/plugins/project/test.lua
@@ -0,0 +1,33 @@
+import("detect.sdks.find_vstudio")
+import("core.project.config")
+import("core.platform.environment")
+
+function test_vsxmake(t)
+
+ if os.host() ~= "windows" then
+ return t:skip("wrong host platform")
+ end
+
+ -- build project
+ local vs = find_vstudio()
+ local arch = os.getenv("platform") or "x86"
+
+ os.cd("c")
+
+ for name, data in pairs(vs) do
+ local vstype = "vsxmake" .. name
+ local path = os.getenv("path")
+ os.setenv("path", data.vcvarsall[arch].path)
+ environment.enter("toolchains")
+ os.execv("xmake", {"project", "-k", vstype, "-a", arch})
+ os.cd(vstype)
+ os.exec("msbuild /t:show")
+ os.exec("msbuild")
+ environment.leave("toolchains")
+ os.setenv("path", path)
+ os.cd("..")
+ os.tryrm(vstype)
+ end
+
+ os.cd("..")
+end