summaryrefslogtreecommitdiff
path: root/tests/plugins/project/test.lua
diff options
context:
space:
mode:
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