Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Steven Rostedt and committed by
Steven Rostedt
dbc6d0aa 0a05c769

+30
+30
tools/testing/ktest/compare-ktest-sample.pl
··· 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 + }