tests CHANGE use prefix on test's sourco files
To distinguish original and test source files in debugger, use test_
prefix for test source files.
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index ee34289..b2d9894 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -21,7 +21,7 @@
message(STATUS ${test_name})
string(REGEX REPLACE "[a-z]*_(.*)" "\\1" name "${test_name}")
string(REGEX REPLACE "([a-z]*)_.*" "\\1" prefix "${test_name}")
- add_executable(${test_name} ${prefix}/${name}.c)
+ add_executable(${test_name} ${prefix}/test_${name}.c)
endforeach(test_name)
# Set common attributes of all tests
diff --git a/tests/src/common.c b/tests/src/test_common.c
similarity index 100%
rename from tests/src/common.c
rename to tests/src/test_common.c
diff --git a/tests/src/context.c b/tests/src/test_context.c
similarity index 97%
rename from tests/src/context.c
rename to tests/src/test_context.c
index 8651b12..d0fc202 100644
--- a/tests/src/context.c
+++ b/tests/src/test_context.c
@@ -91,8 +91,8 @@
assert_int_equal(LY_EINVAL, ly_ctx_set_searchdir(ctx, TESTS_BIN"/src_context"));
logbuf_assert("Given search directory \""TESTS_BIN"/src_context\" is not a directory.");
/* not executable */
- assert_int_equal(LY_EINVAL, ly_ctx_set_searchdir(ctx, TESTS_SRC"/src/context.c"));
- logbuf_assert("Unable to use search directory \""TESTS_SRC"/src/context.c\" (Permission denied)");
+ assert_int_equal(LY_EINVAL, ly_ctx_set_searchdir(ctx, __FILE__));
+ logbuf_assert("Unable to use search directory \""__FILE__"\" (Permission denied)");
/* not existing */
assert_int_equal(LY_EINVAL, ly_ctx_set_searchdir(ctx, "/nonexistingfile"));
logbuf_assert("Unable to use search directory \"/nonexistingfile\" (No such file or directory)");
diff --git a/tests/src/hash_table.c b/tests/src/test_hash_table.c
similarity index 100%
rename from tests/src/hash_table.c
rename to tests/src/test_hash_table.c
diff --git a/tests/src/set.c b/tests/src/test_set.c
similarity index 100%
rename from tests/src/set.c
rename to tests/src/test_set.c
diff --git a/tests/src/xml.c b/tests/src/test_xml.c
similarity index 100%
rename from tests/src/xml.c
rename to tests/src/test_xml.c