diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-11-08 17:18:37 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-11-18 11:23:11 -0500 |
commit | dbc6d0aa8ae38cf9cfe39c6076cc5378ef4ca4a2 (patch) | |
tree | 5502a7b87989c6e95a31eba6abc1cb16225b34e3 /tools | |
parent | 0a05c769a9de554aefa773061c592c7054d5e7a0 (diff) |
ktest: Added compare script to test ktest.pl to sample.conf
Add a compare script that makes sure that all the options in
sample.conf are used in ktest.pl, and all the options in
ktest.pl are described in sample.conf.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/testing/ktest/compare-ktest-sample.pl | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/testing/ktest/compare-ktest-sample.pl b/tools/testing/ktest/compare-ktest-sample.pl new file mode 100755 index 000000000000..9a571e71683c --- /dev/null +++ b/tools/testing/ktest/compare-ktest-sample.pl | |||
@@ -0,0 +1,30 @@ | |||
1 | #!/usr/bin/perl | ||
2 | |||
3 | open (IN,"ktest.pl"); | ||
4 | while (<IN>) { | ||
5 | if (/\$opt\{"?([A-Z].*?)(\[.*\])?"?\}/ || | ||
6 | /set_test_option\("(.*?)"/) { | ||
7 | $opt{$1} = 1; | ||
8 | } | ||
9 | } | ||
10 | close IN; | ||
11 | |||
12 | open (IN, "sample.conf"); | ||
13 | while (<IN>) { | ||
14 | if (/^\s*#?\s*(\S+)\s*=/) { | ||
15 | $samp{$1} = 1; | ||
16 | } | ||
17 | } | ||
18 | close IN; | ||
19 | |||
20 | foreach $opt (keys %opt) { | ||
21 | if (!defined($samp{$opt})) { | ||
22 | print "opt = $opt\n"; | ||
23 | } | ||
24 | } | ||
25 | |||
26 | foreach $samp (keys %samp) { | ||
27 | if (!defined($opt{$samp})) { | ||
28 | print "samp = $samp\n"; | ||
29 | } | ||
30 | } | ||