tests: zlogger nominally runs the daemon
[platform/core/system/dlog.git] / tests / dlog_coverage.in
1 #!/bin/sh
2
3 # dlog is a very low-level system piece so it makes sense that a test
4 # would involve touching the system. We've got a fairly comprehensive
5 # integration test (see `dlog_test.in`) which does that. However, the
6 # process of gathering test coverage really wants us to run something
7 # isolated and we don't have the mana to deal with that properly. So,
8 # here I am going to run a bunch of useless commands in hopes that it
9 # hits as many lines as possible.
10
11
12 @bindir@/tizen-unittests/dlog/test_capi_coverage
13
14 for MODE in monitor priority_exact pid_wrong tid_wrong tag_wrong prefix_wrong sorting clear alias negative misc; do
15         @bindir@/tizen-unittests/dlog/test_libdlogutil_cov $MODE 0 pipe
16 done
17
18 dlogsend -b main -b radio -b apps -b dotnet -b dotnet_api -b native -b native_api bla
19 dlogsend -h
20 dlogsend -kszc 1 -d 1 -f 1 -x
21 dlogsend -k kritzkrieg
22 echo "bla" | dlogsend
23 dlogsend -b main "🚽🥌⚱️🚱"
24
25 dlogutil --help
26 dlogutil --chlep
27 dlogutil -b rutal
28 dlogutil -de 2 -n 2 -r 2 -f '/tmp/dlogutil-testing-chaff'
29 dlogutil -db main --color never --pid 42 --tid 1337
30 dlogutil -b main -c
31 dlogutil -b main -g
32 dlogutil -dv threadtime --color always
33 dlogutil -dv json
34 dlogutil --sort-by height
35 dlogutil --color octarine
36 dlogutil -v hammertime
37 dlogutil -g -b apps
38 dlogutil -g -b main
39 dlogutil -g -b main -b apps
40 dlogutil -m bla -g
41 dlogutil -m bla -c
42 dlogutil --version
43 dlogutil --low-mem-resize low
44 dlogutil -e 3 -e 3
45 dlogutil :D
46 dlogutil -d --pid 123
47 dlogutil -d --tid 123
48 dlogutil -d -m bla
49
50 dlogutil --monitor &
51 UTIL=$!
52 sleep 2
53 kill $UTIL
54
55 dlogutil &
56 UTIL=$!
57 sleep 2
58 kill $UTIL
59
60 dlogutil NONEXISTENT:F &
61 UTIL=$!
62 sleep 3
63 kill $UTIL
64
65 ORIGINAL_CONFIG_PATH="$DLOG_CONFIG_PATH"
66 export DLOG_CONFIG_PATH="@datadir@/dlog-coverage.conf"
67 PATH=$PATH:@libexecdir@/libdlog/
68
69 dlog_logger -t 0 &
70 LOGGER=$!
71 sleep 5
72 echo "blabla" > /dev/kmsg
73
74 # run dlogsend/dlogutil again because this counts for a different backend.
75 dlogsend -b main "blablabla"
76 dlogsend -c 999 -b main "blablabla999"
77 dlogsend -t FLOOD -b main "blablabla"
78 dlog_redirect_stdout --outtag FOO -- /usr/bin/echo Hi
79 dlog_redirect_stdout --errtag BAR -- /usr/bin/sh -c "echo Hi >&2"
80 dlog_redirect_stdout --outbuffer radio --outtag MONTAG --outprio W -- /usr/bin/echo Hi
81 dlog_redirect_stdout --errbuffer radio --errtag DIENSTAG --errprio I -- /usr/bin/sh -c "echo Hi >&2"
82 sleep 0.3233
83 dlogutil -db main
84 dlogutil -db main TEST:*
85 dlogutil -db main TEST:=E
86 dlogutil -db main TEST:E
87 dlogutil -db main *:E
88 dlogutil -db main --pid 123
89 dlogutil -db main --tid 123
90 dlogutil -b main -c
91 dlogutil -b main -g
92 dlogutil -u 10 -db main
93 dlogutil -u 1 -db main
94 dlogutil --sort-by recv_real -db main
95 dlogutil --sort-by recv_mono -db main
96 dlogutil --sort-by sent_real -db main
97 dlogutil --sort-by sent_mono -db main
98 sleep 0.42
99 kill $LOGGER
100
101 DLOG_CONFIG_PATH="$ORIGINAL_CONFIG_PATH"
102