Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dbc6d0aa authored by Steven Rostedt's avatar Steven Rostedt Committed by Steven Rostedt
Browse files

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: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 0a05c769
Loading
Loading
Loading
Loading
+30 −0
Original line number Original line Diff line number Diff line
#!/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";
    }
}