tests: extract stdout redirection 67/304567/1
authorMichal Bloch <m.bloch@samsung.com>
Mon, 15 Jan 2024 16:13:59 +0000 (17:13 +0100)
committerMichal Bloch <m.bloch@samsung.com>
Thu, 18 Jan 2024 11:25:25 +0000 (12:25 +0100)
Change-Id: I13168087ef460e74c203ab0f0311b91f6f2421e8

Makefile.am
configure.ac
packaging/dlog.spec
tests/dlog_test.in
tests/dlog_test_stdout_redirect.in [new file with mode: 0644]

index 8c9ff66..0095a14 100644 (file)
@@ -970,7 +970,7 @@ modulesloadddir = /usr/lib/modules/modules-load.d
 modulesloadd_DATA = \
        configs/tizen-modules-dlog-zero-copy.conf
 
-bin_SCRIPTS = dlog_test dlog_test_header dlog_test_daemon_early_quit dlog_test_tid_filtering_secure_logging dlog_test_backend_autodetection dlog_test_logger_buffering_logging dlog_cpu
+bin_SCRIPTS = dlog_test dlog_test_header dlog_test_daemon_early_quit dlog_test_stdout_redirect dlog_test_tid_filtering_secure_logging dlog_test_backend_autodetection dlog_test_logger_buffering_logging dlog_cpu
 
 
 
index 9566fdd..20fcb45 100644 (file)
@@ -89,6 +89,7 @@ AC_CONFIG_FILES([Makefile dlog.pc dlogutil.pc dlog-redirect-stdout.pc]
                 [run-unittest.sh:tests/dlog_coverage.in]
                 [dlog_test_header:tests/dlog_test_header.in]
                 [dlog_test_daemon_early_quit:tests/dlog_test_daemon_early_quit.in]
+                [dlog_test_stdout_redirect:tests/dlog_test_stdout_redirect.in]
                 [dlog_test_tid_filtering_secure_logging:tests/dlog_test_tid_filtering_secure_logging.in]
                 [dlog_test_backend_autodetection:tests/dlog_test_backend_autodetection.in]
                 [dlog_test_logger_buffering_logging:tests/dlog_test_logger_buffering_logging.in]
index 68daa0d..ad5c513 100644 (file)
@@ -318,6 +318,7 @@ chsmack -e 'System' %{_libexecdir}/dlog-log-critical
 %{_bindir}/dlog_test_daemon_early_quit
 %{_bindir}/dlog_test_backend_autodetection
 %{_bindir}/dlog_test_tid_filtering_secure_logging
+%{_bindir}/dlog_test_stdout_redirect
 %{_bindir}/dlog_test_logger_buffering_logging
 %{_bindir}/dlog_cpu
 /usr/share/doc/dlog/README.testsuite
index b9470aa..590e139 100644 (file)
@@ -1100,18 +1100,7 @@ test_verifytime && ok || fail
 
 DLOG_PREV_PATH=$DLOG_CONFIG_PATH
 
-LOG_DETAILS="testing if config has control over redirecting to stdout (1/3)"
-DLOG_CONFIG_PATH="@datadir@/dlog-$type.conf.stdout_enable.1"
-
-test_config_redirect 1 1 1 1 && ok || fail
-
-LOG_DETAILS="testing if config has control over redirecting to stdout (2/3)"
-DLOG_CONFIG_PATH="@datadir@/dlog-$type.conf.stdout_enable.2"
-test_config_redirect 0 0 1 1 && ok || fail
-
-LOG_DETAILS="testing if config has control over redirecting to stdout (3/3)"
-DLOG_CONFIG_PATH="@datadir@/dlog-$type.conf.stdout_enable.3"
-test_config_redirect 1 1 0 0 && ok || fail
+dlog_test_stdout_redirect $type
 
 DLOG_CONFIG_PATH=$DLOG_PREV_PATH
 
diff --git a/tests/dlog_test_stdout_redirect.in b/tests/dlog_test_stdout_redirect.in
new file mode 100644 (file)
index 0000000..0f9fed1
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+source dlog_test_header
+
+trap cleanup 0
+
+if [ "$1" = "zero-copy" ]; then
+       echo "zero-copy not supported for this test"
+       exit 1
+fi
+
+LOG_DETAILS="testing if config has control over redirecting to stdout (1/3)"
+DLOG_CONFIG_PATH="@datadir@/dlog-$type.conf.stdout_enable.1"
+
+test_config_redirect 1 1 1 1 && ok || fail
+
+LOG_DETAILS="testing if config has control over redirecting to stdout (2/3)"
+DLOG_CONFIG_PATH="@datadir@/dlog-$type.conf.stdout_enable.2"
+test_config_redirect 0 0 1 1 && ok || fail
+
+LOG_DETAILS="testing if config has control over redirecting to stdout (3/3)"
+DLOG_CONFIG_PATH="@datadir@/dlog-$type.conf.stdout_enable.3"
+test_config_redirect 1 1 0 0 && ok || fail
+
+