Archived
14
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/tools/testing/ktest/compare-ktest-sample.pl
Steven Rostedt dbc6d0aa8a 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>
2010-11-18 11:23:11 -05:00

31 lines
460 B
Perl
Executable file

#!/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";
}
}