mirror of https://github.com/getdnsapi/getdns.git
Write libcheck logfiles via env variables
This commit is contained in:
parent
e36ece2b88
commit
94c73b6ec8
|
@ -153,10 +153,10 @@ nolibcheck:
|
|||
|
||||
test: $(NOLIBCHECK) all
|
||||
(cd $(srcdir)/../.. && find . -type f -executable -and \( -name "*.[ch]" -or -name "*.html" -or -name "*.in" -or -name "*.good" -or -name "*.ac" \) | awk 'BEGIN{e=0}{print("ERROR! Executable bit found on", $$0);e=1}END{exit(e)}')
|
||||
./$(CHECK_GETDNS)
|
||||
if test $(have_libevent) = 1 ; then ./$(CHECK_EVENT_PROG) ; fi
|
||||
if test $(have_libev) = 1 ; then ./$(CHECK_EV_PROG) ; fi
|
||||
if test $(have_libuv) = 1 ; then ./$(CHECK_UV_PROG) ; fi
|
||||
CK_LOG_FILE_NAME="$(CHECK_GETDNS).log" ./$(CHECK_GETDNS)
|
||||
if test $(have_libevent) = 1 ; then CK_LOG_FILE_NAME="$(CHECK_EVENT_PROG).log" ./$(CHECK_EVENT_PROG) ; fi
|
||||
if test $(have_libev) = 1 ; then CK_LOG_FILE_NAME="$(CHECK_EV_PROG).log" ./$(CHECK_EV_PROG) ; fi
|
||||
if test $(have_libuv) = 1 ; then CK_LOG_FILE_NAME="$(CHECK_UV_PROG).log" ./$(CHECK_UV_PROG) ; fi
|
||||
@echo "All tests OK"
|
||||
|
||||
clean:
|
||||
|
|
|
@ -20,3 +20,10 @@ A typical flow might be illustrated via tests_list:
|
|||
|
||||
Some of the tests that remain to be implemented:
|
||||
- memory leak testing integrated into the test progs
|
||||
|
||||
libcheck facilitates selectively debugging of specific cases.
|
||||
Example usage:
|
||||
$ CK_LOG_FILE_NAME="/dev/stderr" CK_FORK=no \
|
||||
CK_RUN_SUITE="getdns_context_set_timeout()" CK_RUN_CASE="Positive" \
|
||||
../../libtool exe gdb --args ./check_getdns
|
||||
|
||||
|
|
|
@ -76,7 +76,6 @@ main (int argc, char** argv)
|
|||
{
|
||||
int number_failed;
|
||||
SRunner *sr ;
|
||||
char log_fn[1024], *exe_fn;
|
||||
|
||||
Suite *getdns_general_suite(void);
|
||||
Suite *getdns_general_sync_suite(void);
|
||||
|
@ -153,20 +152,6 @@ main (int argc, char** argv)
|
|||
srunner_add_suite(sr,getdns_service_sync_suite());
|
||||
srunner_add_suite(sr,getdns_transport_suite());
|
||||
|
||||
if ((exe_fn = strrchr(argv[0], '/')) && *exe_fn) {
|
||||
exe_fn += 1;
|
||||
if (exe_fn[0] == 'l' && exe_fn[1] == 't' && exe_fn[2] == '-') {
|
||||
exe_fn += 3;
|
||||
}
|
||||
if (strlen(strncpy(log_fn, exe_fn, sizeof(log_fn) - 1)) < sizeof(log_fn) - 5) {
|
||||
(void) strncat(log_fn, ".log", 4);
|
||||
srunner_set_log(sr, log_fn);
|
||||
}
|
||||
else
|
||||
srunner_set_log(sr, "check_getdns.log");
|
||||
}
|
||||
else
|
||||
srunner_set_log(sr, "check_getdns.log");
|
||||
srunner_run_all(sr, CK_NORMAL);
|
||||
number_failed = srunner_ntests_failed(sr);
|
||||
srunner_free(sr);
|
||||
|
|
Loading…
Reference in New Issue