summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-11-04 00:37:49 +0800
committerruki <[email protected]>2023-11-04 00:37:49 +0800
commitfac89c711d7678ec6d61f63fa66c5e342dada07c (patch)
tree161ea04bcf69f5ad1f20a7fce8e7caeec5a16e35
parent3759d000d365d9b53c515de73989398230e8bf9f (diff)
remove files for test
-rw-r--r--tests/projects/c++/doctest/tests/test_1.cpp2
-rw-r--r--xmake/actions/test/main.lua4
-rw-r--r--xmake/core/project/target.lua2
3 files changed, 4 insertions, 4 deletions
diff --git a/tests/projects/c++/doctest/tests/test_1.cpp b/tests/projects/c++/doctest/tests/test_1.cpp
index 8ab727d06..84b726cf2 100644
--- a/tests/projects/c++/doctest/tests/test_1.cpp
+++ b/tests/projects/c++/doctest/tests/test_1.cpp
@@ -5,7 +5,7 @@ int factorial(int number) {
}
TEST_CASE("testing the factorial function") {
- CHECK(factorial(1) == 1);
+ CHECK(factorial(1) == 10);
CHECK(factorial(2) == 2);
CHECK(factorial(3) == 6);
CHECK(factorial(10) == 3628800);
diff --git a/xmake/actions/test/main.lua b/xmake/actions/test/main.lua
index 8961af6b7..3b4b9540c 100644
--- a/xmake/actions/test/main.lua
+++ b/xmake/actions/test/main.lua
@@ -65,7 +65,7 @@ function _do_test_target(target, opt)
errors = errdata or errors
if not errors or #errors == 0 then
if ok ~= nil then
- errors = string.format("run failed, exit code: %d", ok)
+ errors = string.format("%s\nrun failed, exit code: %d", outdata or "", ok)
else
errors = string.format("run failed, exit error: %s", syserrors and syserrors or "unknown reason")
end
@@ -366,7 +366,7 @@ function main()
for _, file in ipairs(extra.remove_files) do
file = path.absolute(file, scriptdir)
file = path.relative(file, os.projectdir())
- target_new:add("remove_files", file)
+ target_new:remove("files", file)
end
testinfo.target = target_new
end
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index 388579174..32fc41596 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -274,7 +274,7 @@ function _instance:_invalidate(name)
self._CACHEID = self._CACHEID + 1
self._POLICIES = nil
-- we need to flush the source files cache if target/files are modified, e.g. `target:add("files", "xxx.c")`
- if name == "files" or name == "remove_files" then
+ if name == "files" then
self._SOURCEFILES = nil
elseif name == "deps" then
self._DEPS = nil