소스 검색

ktest: Fix compare script to test if options are not documented

The compare script compare-ktest-sample.pl checks for options
that are defined in ktest.pl and not documented in samples.conf,
as well as samples in samples.conf that are not used in ktest.pl.

With the switch to the hash format to initialize the ktest variables
the compare script needs to be updated to handle the change.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Steven Rostedt 14 년 전
부모
커밋
c2857cb4a8
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      tools/testing/ktest/compare-ktest-sample.pl

+ 3 - 1
tools/testing/ktest/compare-ktest-sample.pl

@@ -2,7 +2,9 @@
 
 
 open (IN,"ktest.pl");
 open (IN,"ktest.pl");
 while (<IN>) {
 while (<IN>) {
+    # hashes are now used
     if (/\$opt\{"?([A-Z].*?)(\[.*\])?"?\}/ ||
     if (/\$opt\{"?([A-Z].*?)(\[.*\])?"?\}/ ||
+	/^\s*"?([A-Z].*?)"?\s*=>\s*/ ||
 	/set_test_option\("(.*?)"/) {
 	/set_test_option\("(.*?)"/) {
 	$opt{$1} = 1;
 	$opt{$1} = 1;
     }
     }
@@ -11,7 +13,7 @@ close IN;
 
 
 open (IN, "sample.conf");
 open (IN, "sample.conf");
 while (<IN>) {
 while (<IN>) {
-    if (/^\s*#?\s*(\S+)\s*=/) {
+    if (/^\s*#?\s*([A-Z]\S*)\s*=/) {
 	$samp{$1} = 1;
 	$samp{$1} = 1;
     }
     }
 }
 }