Merge branches 'pm-cpufreq', 'pm-cpuidle', 'pm-devfreq', 'pm-opp' and 'pm-tools'
[linux-drm-fsl-dcu.git] / tools / testing / selftests / rcutorture / bin / parse-build.sh
1 #!/bin/bash
2 #
3 # Check the build output from an rcutorture run for goodness.
4 # The "file" is a pathname on the local system, and "title" is
5 # a text string for error-message purposes.
6 #
7 # The file must contain kernel build output.
8 #
9 # Usage: parse-build.sh file title
10 #
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2 of the License, or
14 # (at your option) any later version.
15 #
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 # GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, you can access it online at
23 # http://www.gnu.org/licenses/gpl-2.0.html.
24 #
25 # Copyright (C) IBM Corporation, 2011
26 #
27 # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
28
29 F=$1
30 title=$2
31 T=/tmp/parse-build.sh.$$
32 trap 'rm -rf $T' 0
33 mkdir $T
34
35 . functions.sh
36
37 if grep -q CC < $F
38 then
39         :
40 else
41         print_bug $title no build
42         exit 1
43 fi
44
45 if grep -q "error:" < $F
46 then
47         print_bug $title build errors:
48         grep "error:" < $F
49         exit 2
50 fi
51
52 grep warning: < $F > $T/warnings
53 grep "include/linux/*rcu*\.h:" $T/warnings > $T/hwarnings
54 grep "kernel/rcu/[^/]*:" $T/warnings > $T/cwarnings
55 cat $T/hwarnings $T/cwarnings > $T/rcuwarnings
56 if test -s $T/rcuwarnings
57 then
58         print_warning $title build errors:
59         cat $T/rcuwarnings
60         exit 2
61 fi
62 exit 0