diff options
| author | OpportunityLiu <[email protected]> | 2019-07-16 14:33:37 +0800 |
|---|---|---|
| committer | OpportunityLiu <[email protected]> | 2019-07-16 14:33:37 +0800 |
| commit | 9a10fde3739ccf1c5ef10657a827fa43076362da (patch) | |
| tree | f4e41f6adf2a458ca7f81f6bf43fc22f2e38bdb7 /tests/plugins/project/test.lua | |
| parent | 89baf2ecdca1fb8bd25c449b3f3b05b47706377d (diff) | |
remove project file; use catch
Diffstat (limited to 'tests/plugins/project/test.lua')
| -rw-r--r-- | tests/plugins/project/test.lua | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/tests/plugins/project/test.lua b/tests/plugins/project/test.lua index 32fffd33c..0bf08208c 100644 --- a/tests/plugins/project/test.lua +++ b/tests/plugins/project/test.lua @@ -9,11 +9,16 @@ function test_vsxmake(t) return t:skip("wrong host platform") end + local projname = "testproj" + + -- create project + os.runv("xmake", {"create", projname}) + -- build project local vs = find_vstudio() local arch = os.getenv("platform") or "x86" - os.cd("c") + os.cd(projname) for name, _ in pairs(vs) do if tonumber(name) >= 2010 then @@ -34,18 +39,15 @@ function test_vsxmake(t) function () os.exec("msbuild /P:XmakeDiagnosis=true /P:XmakeVerbose=true") end, - finally + catch { - function (ok) - if ok then - return - end + function () io.write("--- sln file ---\n") - io.write(io.readfile("c_" .. vstype .. ".sln"), "\n") + io.write(io.readfile(projname .. "_" .. vstype .. ".sln"), "\n") io.write("--- vcx file ---\n") - io.write(io.readfile("project/project.vcxproj"), "\n") + io.write(io.readfile(projname .. "/" .. projname .. ".vcxproj"), "\n") io.write("--- filter file ---\n") - io.write(io.readfile("project/project.vcxproj.filters"), "\n") + io.write(io.readfile(projname .. "/" .. projname .. ".vcxproj.filters"), "\n") raise("msbuild failed") end } @@ -57,5 +59,7 @@ function test_vsxmake(t) end end + -- clean up os.cd("..") + os.tryrm(projname) end |
