Skip to content

Commit

Permalink
ktest: Added compare script to test ktest.pl to sample.conf
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Nov 18, 2010
1 parent 0a05c76 commit dbc6d0a
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tools/testing/ktest/compare-ktest-sample.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/perl

open (IN,"ktest.pl");
while (<IN>) {
if (/\$opt\{"?([A-Z].*?)(\[.*\])?"?\}/ ||
/set_test_option\("(.*?)"/) {
$opt{$1} = 1;
}
}
close IN;

open (IN, "sample.conf");
while (<IN>) {
if (/^\s*#?\s*(\S+)\s*=/) {
$samp{$1} = 1;
}
}
close IN;

foreach $opt (keys %opt) {
if (!defined($samp{$opt})) {
print "opt = $opt\n";
}
}

foreach $samp (keys %samp) {
if (!defined($opt{$samp})) {
print "samp = $samp\n";
}
}

0 comments on commit dbc6d0a

Please sign in to comment.