summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorruki <[email protected]>2020-12-17 10:59:28 +0800
committerGitHub <[email protected]>2020-12-17 10:59:28 +0800
commite95f99d7d99daf3c065dd04d457b2a8a81545380 (patch)
tree72816b1c749dd12e31da06b9b9d97ffc8d057866 /tests
parent37521d4aa857d57773b0f6cb9311856d3787c6f5 (diff)
parent98a044d2947d070d035fe76c651fdbf9f0c3b135 (diff)
Merge pull request #1141 from xmake-io/toolchain
Improve toolchain
Diffstat (limited to 'tests')
-rw-r--r--tests/plugins/project/test.lua3
-rw-r--r--tests/projects/objc/iosapp/xmake.lua1
-rw-r--r--tests/projects/other/multiplats_vs/.gitignore8
-rw-r--r--tests/projects/other/multiplats_vs/src/main.cpp9
-rw-r--r--tests/projects/other/multiplats_vs/src/test.asm1
-rw-r--r--tests/projects/other/multiplats_vs/src/test.rc0
-rw-r--r--tests/projects/other/multiplats_vs/test.lua7
-rw-r--r--tests/projects/other/multiplats_vs/xmake.lua18
-rw-r--r--tests/projects/other/multiplats_xcode/src/main.c7
-rw-r--r--tests/projects/other/multiplats_xcode/test.lua8
-rw-r--r--tests/projects/other/multiplats_xcode/xmake.lua15
11 files changed, 75 insertions, 2 deletions
diff --git a/tests/plugins/project/test.lua b/tests/plugins/project/test.lua
index 5cc1e7e0e..1aac20088 100644
--- a/tests/plugins/project/test.lua
+++ b/tests/plugins/project/test.lua
@@ -21,8 +21,7 @@ function test_vsxmake(t)
-- set config
local arch = os.getenv("platform") or "x86"
config.set("arch", arch, {readonly = true, force = true})
- config.check()
- platform.load(config.plat())
+ platform.load(config.plat(), arch):check()
-- create sln & vcxproj
local vs = config.get("vs")
diff --git a/tests/projects/objc/iosapp/xmake.lua b/tests/projects/objc/iosapp/xmake.lua
index e1e9e6d74..05f445980 100644
--- a/tests/projects/objc/iosapp/xmake.lua
+++ b/tests/projects/objc/iosapp/xmake.lua
@@ -4,3 +4,4 @@ target("test")
add_rules("xcode.application")
add_files("src/*.m", "src/**.storyboard", "src/*.xcassets")
add_files("src/Info.plist")
+ set_plat("iphoneos")
diff --git a/tests/projects/other/multiplats_vs/.gitignore b/tests/projects/other/multiplats_vs/.gitignore
new file mode 100644
index 000000000..152105761
--- /dev/null
+++ b/tests/projects/other/multiplats_vs/.gitignore
@@ -0,0 +1,8 @@
+# Xmake cache
+.xmake/
+build/
+
+# MacOS Cache
+.DS_Store
+
+
diff --git a/tests/projects/other/multiplats_vs/src/main.cpp b/tests/projects/other/multiplats_vs/src/main.cpp
new file mode 100644
index 000000000..7c435d251
--- /dev/null
+++ b/tests/projects/other/multiplats_vs/src/main.cpp
@@ -0,0 +1,9 @@
+#include <iostream>
+
+using namespace std;
+
+int main(int argc, char** argv)
+{
+ cout << "hello world!" << endl;
+ return 0;
+}
diff --git a/tests/projects/other/multiplats_vs/src/test.asm b/tests/projects/other/multiplats_vs/src/test.asm
new file mode 100644
index 000000000..8b1378917
--- /dev/null
+++ b/tests/projects/other/multiplats_vs/src/test.asm
@@ -0,0 +1 @@
+
diff --git a/tests/projects/other/multiplats_vs/src/test.rc b/tests/projects/other/multiplats_vs/src/test.rc
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/projects/other/multiplats_vs/src/test.rc
diff --git a/tests/projects/other/multiplats_vs/test.lua b/tests/projects/other/multiplats_vs/test.lua
new file mode 100644
index 000000000..795df5c95
--- /dev/null
+++ b/tests/projects/other/multiplats_vs/test.lua
@@ -0,0 +1,7 @@
+function test_multivs(t)
+ if is_subhost("windows") then
+ t:build()
+ else
+ return t:skip("wrong host platform")
+ end
+end
diff --git a/tests/projects/other/multiplats_vs/xmake.lua b/tests/projects/other/multiplats_vs/xmake.lua
new file mode 100644
index 000000000..4e61a20a1
--- /dev/null
+++ b/tests/projects/other/multiplats_vs/xmake.lua
@@ -0,0 +1,18 @@
+add_rules("mode.debug", "mode.release")
+
+rule("vs2015_x86")
+ before_load(function (target)
+ target:set("arch", "x86")
+ target:set("toolchains", "msvc", {vs = "2015"})
+ end)
+
+target("testvs_vs2015_x86")
+ set_kind("binary")
+ add_files("src/*.cpp", "src/*.rc")
+ add_rules("vs2015_x86")
+
+target("testvs")
+ set_kind("binary")
+ add_files("src/*.cpp", "src/*.rc")
+
+
diff --git a/tests/projects/other/multiplats_xcode/src/main.c b/tests/projects/other/multiplats_xcode/src/main.c
new file mode 100644
index 000000000..9ae580511
--- /dev/null
+++ b/tests/projects/other/multiplats_xcode/src/main.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int main(int argc, char** argv)
+{
+ printf("hello world!\n");
+ return 0;
+}
diff --git a/tests/projects/other/multiplats_xcode/test.lua b/tests/projects/other/multiplats_xcode/test.lua
new file mode 100644
index 000000000..196797077
--- /dev/null
+++ b/tests/projects/other/multiplats_xcode/test.lua
@@ -0,0 +1,8 @@
+function main(t)
+ if is_host("macosx") then
+ os.exec("xmake f -c -vD")
+ os.exec("xmake -rvD")
+ os.exec("xmake f -c -vD -p iphoneos")
+ os.exec("xmake -rvD")
+ end
+end
diff --git a/tests/projects/other/multiplats_xcode/xmake.lua b/tests/projects/other/multiplats_xcode/xmake.lua
new file mode 100644
index 000000000..e8fbbb372
--- /dev/null
+++ b/tests/projects/other/multiplats_xcode/xmake.lua
@@ -0,0 +1,15 @@
+add_rules("mode.debug", "mode.release")
+target("test_host")
+ set_kind("binary")
+ add_files("src/*.c")
+
+target("test_iphoneos")
+ set_kind("binary")
+ add_files("src/*.c")
+ set_plat("iphoneos")
+
+target("test_iphoneos_armv7")
+ set_kind("binary")
+ add_files("src/*.c")
+ set_plat("iphoneos")
+ set_arch("armv7")