diff options
| author | ruki <[email protected]> | 2026-02-05 22:56:08 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-05 22:56:08 +0800 |
| commit | 4f828e01189fb138b21b82718edb876f0d36049e (patch) | |
| tree | 6aaf0105b3aae50b8db9512092a58343215ad4ea /tests | |
| parent | be074db5aa346a36529c13e8b58db3600a6f1f32 (diff) | |
| parent | 6f6de142f94b438c36308f7ad774a9ca7a2c945a (diff) | |
Merge pull request #7295 from xmake-io/testout
support test output files
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/actions/test/outputs/fail_hello_xmake.txt | 1 | ||||
| -rw-r--r-- | tests/actions/test/outputs/pass_hello_foo.txt | 1 | ||||
| -rw-r--r-- | tests/actions/test/xmake.lua | 8 |
3 files changed, 9 insertions, 1 deletions
diff --git a/tests/actions/test/outputs/fail_hello_xmake.txt b/tests/actions/test/outputs/fail_hello_xmake.txt new file mode 100644 index 000000000..32650dceb --- /dev/null +++ b/tests/actions/test/outputs/fail_hello_xmake.txt @@ -0,0 +1 @@ +hello xmake diff --git a/tests/actions/test/outputs/pass_hello_foo.txt b/tests/actions/test/outputs/pass_hello_foo.txt new file mode 100644 index 000000000..dfbb21580 --- /dev/null +++ b/tests/actions/test/outputs/pass_hello_foo.txt @@ -0,0 +1 @@ +hello foo diff --git a/tests/actions/test/xmake.lua b/tests/actions/test/xmake.lua index d8de81f9a..eb1cef888 100644 --- a/tests/actions/test/xmake.lua +++ b/tests/actions/test/xmake.lua @@ -13,6 +13,13 @@ for _, file in ipairs(os.files("src/test_*.cpp")) do add_tests("fail_output", {fail_outputs = {"hello2 .*", "hello xmake"}}) end +target("test_output_files") + set_kind("binary") + set_default(false) + add_files("src/test_1.cpp") + add_tests("pass_output_file", {trim_output = true, runargs = "foo", pass_output_files = "outputs/pass_hello_foo.txt"}) + add_tests("fail_output_file", {trim_output = true, should_fail = true, fail_output_files = "outputs/fail_hello_xmake.txt"}) + target("test_10") set_kind("binary") set_default(false) @@ -48,4 +55,3 @@ target("test_timeout") set_default(false) add_files("src/run_timeout.cpp") add_tests("run_timeout", {run_timeout = 1000}) - |
