1 #!/usr/bin/env perl 1 #!/usr/bin/env perl 2 # SPDX-License-Identifier: GPL-2.0 2 # SPDX-License-Identifier: GPL-2.0 3 3 4 open (IN,"ktest.pl"); 4 open (IN,"ktest.pl"); 5 while (<IN>) { 5 while (<IN>) { 6 # hashes are now used 6 # hashes are now used 7 if (/\$opt\{"?([A-Z].*?)(\[.*\])?"?\}/ || 7 if (/\$opt\{"?([A-Z].*?)(\[.*\])?"?\}/ || 8 /^\s*"?([A-Z].*?)"?\s*=>\s*/ || 8 /^\s*"?([A-Z].*?)"?\s*=>\s*/ || 9 /set_test_option\("(.*?)"/) { 9 /set_test_option\("(.*?)"/) { 10 $opt{$1} = 1; 10 $opt{$1} = 1; 11 } 11 } 12 } 12 } 13 close IN; 13 close IN; 14 14 15 open (IN, "sample.conf"); 15 open (IN, "sample.conf"); 16 while (<IN>) { 16 while (<IN>) { 17 if (/^\s*#?\s*([A-Z]\S*)\s*=/) { 17 if (/^\s*#?\s*([A-Z]\S*)\s*=/) { 18 $samp{$1} = 1; 18 $samp{$1} = 1; 19 } 19 } 20 } 20 } 21 close IN; 21 close IN; 22 22 23 foreach $opt (keys %opt) { 23 foreach $opt (keys %opt) { 24 if (!defined($samp{$opt})) { 24 if (!defined($samp{$opt})) { 25 print "opt = $opt\n"; 25 print "opt = $opt\n"; 26 } 26 } 27 } 27 } 28 28 29 foreach $samp (keys %samp) { 29 foreach $samp (keys %samp) { 30 if (!defined($opt{$samp})) { 30 if (!defined($opt{$samp})) { 31 print "samp = $samp\n"; 31 print "samp = $samp\n"; 32 } 32 } 33 } 33 }
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.