diff options
| author | OpportunityLiu <[email protected]> | 2019-07-15 21:56:01 +0800 |
|---|---|---|
| committer | OpportunityLiu <[email protected]> | 2019-07-15 21:56:01 +0800 |
| commit | 9ce1420b43db72da9d6a57bcc3d4ba478d614484 (patch) | |
| tree | 2fc47c2a696d01d57505344e50fa3092118667a0 /tests/cli/utils/test.lua | |
| parent | fadf38f8d4b5ad94dcf02360bdcc946d45f53ba8 (diff) | |
test: add cli tests for --version and --help
Diffstat (limited to 'tests/cli/utils/test.lua')
| -rw-r--r-- | tests/cli/utils/test.lua | 12 |
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 |
