summaryrefslogtreecommitdiff
path: root/tests/plugins/project/test.lua
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-07-16 13:21:15 +0800
committerOpportunityLiu <[email protected]>2019-07-16 13:21:15 +0800
commitac06d2aa0eb76a933a843aa37878535a427e8599 (patch)
treeea50ce64953298fc0e6fab30c00b0f28b4ca0887 /tests/plugins/project/test.lua
parentc63d5c42136e92ad16eb81cc1b01db34d29792d1 (diff)
fix env
Diffstat (limited to 'tests/plugins/project/test.lua')
-rw-r--r--tests/plugins/project/test.lua17
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/plugins/project/test.lua b/tests/plugins/project/test.lua
index a9f1fa37e..b647d52d9 100644
--- a/tests/plugins/project/test.lua
+++ b/tests/plugins/project/test.lua
@@ -1,5 +1,6 @@
import("detect.sdks.find_vstudio")
import("core.project.config")
+import("core.platform.platform")
import("core.platform.environment")
function test_vsxmake(t)
@@ -14,17 +15,23 @@ function test_vsxmake(t)
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)
+ 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")
+
+ local vstype = "vsxmake" .. name
+ -- create sln & vcxproj
os.execv("xmake", {"project", "-k", vstype, "-a", arch})
os.cd(vstype)
+ -- run msbuild
os.exec("msbuild /t:show")
os.exec("msbuild")
environment.leave("toolchains")
- os.setenv("path", path)
+ -- clean up
os.cd("..")
os.tryrm(vstype)
end