summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleš Matěj <amatej@redhat.com>2021-02-24 09:09:39 +0100
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>2021-03-30 09:11:27 -0400
commit72d0fc5a07ac0eab9e0fdc7753de5faebe253f94 (patch)
treea22d0b4ff8472857abe5fd8cef1d99555dd73e8b
parent3110e7b577c8a9db7bcdf53bc674fa1fc1efbfeb (diff)
Run c tests directly without gtester
gtester has beed depricated since GLib 2.62 and we don't really need it. The c tests output is only differently formatted and it also includes Debug messages which gtester was hiding even in verbose mode. closes: https://github.com/rpm-software-management/createrepo_c/issues/239
-rw-r--r--README.md2
-rw-r--r--tests/CMakeLists.txt4
-rwxr-xr-xtests/run_tests.sh.in (renamed from tests/run_gtester.sh.in)8
3 files changed, 5 insertions, 9 deletions
diff --git a/README.md b/README.md
index d0a3fc0..de2cd01 100644
--- a/README.md
+++ b/README.md
@@ -146,7 +146,7 @@ Note: For a verbose output of testing use: ``make ARGS="-V" test``
### Run only C unittests (from your checkout dir):
- build/tests/run_gtester.sh
+ build/tests/run_tests.sh
Note: The C tests have to be built by ``make tests``)!
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 19e91fa..3936176 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -54,8 +54,8 @@ ADD_EXECUTABLE(test_modifyrepo_shared test_modifyrepo_shared.c)
TARGET_LINK_LIBRARIES(test_modifyrepo_shared libcreaterepo_c ${GLIB2_LIBRARIES})
ADD_DEPENDENCIES(tests test_modifyrepo_shared)
-CONFIGURE_FILE("run_gtester.sh.in" "${CMAKE_BINARY_DIR}/tests/run_gtester.sh")
-ADD_TEST(test_main run_gtester.sh)
+CONFIGURE_FILE("run_tests.sh.in" "${CMAKE_BINARY_DIR}/tests/run_tests.sh")
+ADD_TEST(test_main run_tests.sh)
IF (ENABLE_PYTHON)
ADD_SUBDIRECTORY(python)
diff --git a/tests/run_gtester.sh.in b/tests/run_tests.sh.in
index 7dae2dd..db53cdc 100755
--- a/tests/run_gtester.sh.in
+++ b/tests/run_tests.sh.in
@@ -9,11 +9,6 @@ RET=0
# object file: No such file or directory" error message.
export "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/src/:"
-function runtest {
- gtester --verbose --keep-going "$1"
- if [ $? -ne 0 ]; then RET=$(($RET+1)) ; fi
-}
-
# Go to source dir (so test would be able to use testdata/ in this dir)
cd ${CMAKE_CURRENT_SOURCE_DIR}
@@ -21,7 +16,8 @@ cd ${CMAKE_CURRENT_SOURCE_DIR}
for i in "$BINDIR"/test_*; do
# Run only executable regular files with "test_" prefix
if [ -f $i -a -x $i ]; then
- runtest "$i"
+ $i #execute the test
+ if [ $? -ne 0 ]; then RET=$(($RET+1)) ; fi
fi
done