597e385dc3463f6f60cf555c8f8e8fdaf24d951b
[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; do
15         @bindir@/tizen-unittests/dlog/test_libdlogutil_cov $MODE 123 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 dlogsend -b main "blablabla"
74 dlogsend -c 999 -b main "blablabla999"
75 dlogsend -t FLOOD -b main "blablabla"
76 sleep 0.3233
77 dlogutil -db main
78 dlogutil -u 10 -db main
79 dlogutil -u 1 -db main
80 dlogutil --sort-by recv_real -db main
81 dlogutil --sort-by recv_mono -db main
82 dlogutil --sort-by sent_real -db main
83 dlogutil --sort-by sent_mono -db main
84 sleep 0.42
85 kill $LOGGER
86
87 DLOG_CONFIG_PATH="$ORIGINAL_CONFIG_PATH"
88