summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-07-15 22:26:51 +0800
committerGitHub <[email protected]>2019-07-15 22:26:51 +0800
commitd6be8e7effeca32a035ce89f1d02c28501b6a839 (patch)
tree2fc47c2a696d01d57505344e50fa3092118667a0
parentfadf38f8d4b5ad94dcf02360bdcc946d45f53ba8 (diff)
parent9ce1420b43db72da9d6a57bcc3d4ba478d614484 (diff)
Merge pull request #485 from OpportunityLiu/dev
test: add cli tests for --version and --help
-rw-r--r--tests/cli/utils/test.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/cli/utils/test.lua b/tests/cli/utils/test.lua
new file mode 100644
index 000000000..f06a303a9
--- /dev/null
+++ b/tests/cli/utils/test.lua
@@ -0,0 +1,12 @@
+function test_version(t)
+ local output = os.iorunv("xmake", {"--version"})
+ local vstr = output:match("xmake v(.-),")
+ t:are_equal(vstr, tostring(xmake.version()))
+end
+
+function test_help(t)
+ import("core.base.task")
+ for _, t in ipairs(task.names()) do
+ os.execv("xmake", {t, "--help"})
+ end
+end