Commit | Line | Data |
---|---|---|
6e0ca3c2 DG |
1 | #!/bin/bash |
2 | # | |
3 | # Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca> | |
4 | # | |
5 | # This program is free software; you can redistribute it and/or | |
6 | # modify it under the terms of the GNU General Public License | |
63371d1e DG |
7 | # as published by the Free Software Foundation; only version 2 |
8 | # of the License. | |
6e0ca3c2 DG |
9 | # |
10 | # This program is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | # GNU General Public License for more details. | |
14 | # | |
15 | # You should have received a copy of the GNU General Public License | |
16 | # along with this program; if not, write to the Free Software | |
17 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
18 | # | |
19 | ||
6e0ca3c2 DG |
20 | #### ADD TESTS HERE #### |
21 | ||
fd4dfcec DG |
22 | # A spawned session daemon is needed for those tests |
23 | test_with_sessiond=( lttng/runall.sh ust-nevents/run ust-nprocesses/run ) | |
24 | ||
25 | # No session daemon needed | |
26 | test_no_sessiond=( test_sessions test_kernel_data_trace test_ust_data_trace ) | |
897b8e23 DG |
27 | |
28 | #### END TESTS HERE #### | |
29 | ||
d3e8f6bb DG |
30 | TESTDIR=$(dirname $0) |
31 | ||
32 | source $TESTDIR/utils.sh | |
33 | ||
fd4dfcec DG |
34 | ## NO Session daemon ## |
35 | for bin in ${test_no_sessiond[@]}; | |
36 | do | |
37 | if [ ! -e $bin ]; then | |
38 | echo -e "$bin not found, passing" | |
39 | continue | |
40 | fi | |
41 | ||
42 | ./$bin | |
43 | # Test must return 0 to pass. | |
44 | if [ $? -ne 0 ]; then | |
45 | echo -e '\e[1;31mFAIL\e[0m' | |
46 | echo "" | |
47 | exit 1 | |
48 | fi | |
49 | done | |
50 | ||
51 | # With session daemon | |
d3e8f6bb | 52 | start_sessiond |
fd4dfcec DG |
53 | out=$? |
54 | if [ $out -eq 2 ]; then | |
55 | # Kernel version is not compatible. | |
56 | exit 0 | |
57 | elif [ $out -ne 0 ]; then | |
58 | echo "NOT bad $?" | |
d3e8f6bb DG |
59 | exit 1 |
60 | fi | |
61 | ||
fd4dfcec | 62 | for bin in ${test_with_sessiond[@]}; |
63371d1e | 63 | do |
ec8f26de DG |
64 | if [ ! -e $bin ]; then |
65 | echo -e "$bin not found, passing" | |
66 | continue | |
67 | fi | |
68 | ||
63371d1e | 69 | ./$bin |
897b8e23 DG |
70 | # Test must return 0 to pass. |
71 | if [ $? -ne 0 ]; then | |
72 | echo -e '\e[1;31mFAIL\e[0m' | |
73 | echo "" | |
d3e8f6bb | 74 | stop_sessiond |
897b8e23 DG |
75 | exit 1 |
76 | fi | |
63371d1e | 77 | done |
6e0ca3c2 | 78 | |
63371d1e | 79 | echo "" |
d3e8f6bb | 80 | stop_sessiond |
6e0ca3c2 | 81 | exit 0 |