summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorruki <[email protected]>2020-07-25 21:25:55 +0800
committerruki <[email protected]>2020-07-25 21:25:55 +0800
commit56c0819b70ee17f8f8f1f5d27d2f905ee34bb726 (patch)
treec66b687e7cb6280066be518a927ec32be65ba366 /tests
parent5d7d07a9d1a2f4728a0857ff42d9a8f09b34bee2 (diff)
improve dlang tests and template projects
Diffstat (limited to 'tests')
-rw-r--r--tests/projects/dlang/console/xmake.lua8
-rw-r--r--tests/projects/dlang/console_with_pkgs/src/main.d6
-rw-r--r--tests/projects/dlang/console_with_pkgs/xmake.lua6
-rw-r--r--tests/projects/dlang/shared_library/xmake.lua24
-rw-r--r--tests/projects/dlang/static_library/xmake.lua23
-rw-r--r--tests/projects/go/console_with_pkgs/src/main.go (renamed from tests/projects/go/console_with_deps/src/main.go)0
-rw-r--r--tests/projects/go/console_with_pkgs/xmake.lua (renamed from tests/projects/go/console_with_deps/xmake.lua)0
-rw-r--r--tests/projects/go/static_library_with_pkgs/src/main.go (renamed from tests/projects/go/static_library_with_deps/src/main.go)0
-rw-r--r--tests/projects/go/static_library_with_pkgs/src/test.go (renamed from tests/projects/go/static_library_with_deps/src/test.go)0
-rw-r--r--tests/projects/go/static_library_with_pkgs/src/test/add.go (renamed from tests/projects/go/static_library_with_deps/src/test/add.go)0
-rw-r--r--tests/projects/go/static_library_with_pkgs/src/test/sub.go (renamed from tests/projects/go/static_library_with_deps/src/test/sub.go)0
-rw-r--r--tests/projects/go/static_library_with_pkgs/xmake.lua (renamed from tests/projects/go/static_library_with_deps/xmake.lua)0
12 files changed, 15 insertions, 52 deletions
diff --git a/tests/projects/dlang/console/xmake.lua b/tests/projects/dlang/console/xmake.lua
index 374a6826a..b1b8e0bfb 100644
--- a/tests/projects/dlang/console/xmake.lua
+++ b/tests/projects/dlang/console/xmake.lua
@@ -1,12 +1,6 @@
--- add rules
add_rules("mode.debug", "mode.release")
--- add target
-target("console_dlang")
-
- -- set kind
+target("test")
set_kind("binary")
-
- -- add files
add_files("src/*.d")
diff --git a/tests/projects/dlang/console_with_pkgs/src/main.d b/tests/projects/dlang/console_with_pkgs/src/main.d
new file mode 100644
index 000000000..524c4f94c
--- /dev/null
+++ b/tests/projects/dlang/console_with_pkgs/src/main.d
@@ -0,0 +1,6 @@
+import std.stdio;
+
+void main()
+{
+ writeln("hello world!");
+}
diff --git a/tests/projects/dlang/console_with_pkgs/xmake.lua b/tests/projects/dlang/console_with_pkgs/xmake.lua
new file mode 100644
index 000000000..b1b8e0bfb
--- /dev/null
+++ b/tests/projects/dlang/console_with_pkgs/xmake.lua
@@ -0,0 +1,6 @@
+add_rules("mode.debug", "mode.release")
+
+target("test")
+ set_kind("binary")
+ add_files("src/*.d")
+
diff --git a/tests/projects/dlang/shared_library/xmake.lua b/tests/projects/dlang/shared_library/xmake.lua
index 7fa8b3b8a..9535bf1d3 100644
--- a/tests/projects/dlang/shared_library/xmake.lua
+++ b/tests/projects/dlang/shared_library/xmake.lua
@@ -1,34 +1,12 @@
--- add rules
add_rules("mode.debug", "mode.release")
--- add target
target("interfaces")
-
- -- set kind
set_kind("shared")
-
- -- add files
add_files("src/interfaces.d")
+ add_includedirs("src", {public = true})
--- add target
target("test")
-
- -- set kind
set_kind("binary")
-
- -- add deps
add_deps("interfaces")
-
- -- add files
add_files("src/main.d")
- -- add links
- add_links("interfaces")
-
- -- add link directory
- add_linkdirs("$(buildir)")
- add_rpathdirs("$(buildir)")
-
- -- add include directory
- add_includedirs("$(projectdir)/src")
-
diff --git a/tests/projects/dlang/static_library/xmake.lua b/tests/projects/dlang/static_library/xmake.lua
index 74699bb04..273462475 100644
--- a/tests/projects/dlang/static_library/xmake.lua
+++ b/tests/projects/dlang/static_library/xmake.lua
@@ -1,33 +1,12 @@
--- add rules
add_rules("mode.debug", "mode.release")
--- add target
target("interfaces")
-
- -- set kind
set_kind("static")
-
- -- add files
add_files("src/interfaces.d")
+ add_includedirs("src", {public = true})
--- add target
target("test")
-
- -- set kind
set_kind("binary")
-
- -- add deps
add_deps("interfaces")
-
- -- add files
add_files("src/main.d")
- -- add links
- add_links("interfaces")
-
- -- add link directory
- add_linkdirs("$(buildir)")
-
- -- add include directory
- add_includedirs("$(projectdir)/src")
-
diff --git a/tests/projects/go/console_with_deps/src/main.go b/tests/projects/go/console_with_pkgs/src/main.go
index 194d6ac86..194d6ac86 100644
--- a/tests/projects/go/console_with_deps/src/main.go
+++ b/tests/projects/go/console_with_pkgs/src/main.go
diff --git a/tests/projects/go/console_with_deps/xmake.lua b/tests/projects/go/console_with_pkgs/xmake.lua
index d3324d855..d3324d855 100644
--- a/tests/projects/go/console_with_deps/xmake.lua
+++ b/tests/projects/go/console_with_pkgs/xmake.lua
diff --git a/tests/projects/go/static_library_with_deps/src/main.go b/tests/projects/go/static_library_with_pkgs/src/main.go
index f2b477453..f2b477453 100644
--- a/tests/projects/go/static_library_with_deps/src/main.go
+++ b/tests/projects/go/static_library_with_pkgs/src/main.go
diff --git a/tests/projects/go/static_library_with_deps/src/test.go b/tests/projects/go/static_library_with_pkgs/src/test.go
index cf10523f9..cf10523f9 100644
--- a/tests/projects/go/static_library_with_deps/src/test.go
+++ b/tests/projects/go/static_library_with_pkgs/src/test.go
diff --git a/tests/projects/go/static_library_with_deps/src/test/add.go b/tests/projects/go/static_library_with_pkgs/src/test/add.go
index b87b21138..b87b21138 100644
--- a/tests/projects/go/static_library_with_deps/src/test/add.go
+++ b/tests/projects/go/static_library_with_pkgs/src/test/add.go
diff --git a/tests/projects/go/static_library_with_deps/src/test/sub.go b/tests/projects/go/static_library_with_pkgs/src/test/sub.go
index a24a9abb7..a24a9abb7 100644
--- a/tests/projects/go/static_library_with_deps/src/test/sub.go
+++ b/tests/projects/go/static_library_with_pkgs/src/test/sub.go
diff --git a/tests/projects/go/static_library_with_deps/xmake.lua b/tests/projects/go/static_library_with_pkgs/xmake.lua
index 6943a29aa..6943a29aa 100644
--- a/tests/projects/go/static_library_with_deps/xmake.lua
+++ b/tests/projects/go/static_library_with_pkgs/xmake.lua