^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) #!/usr/bin/env perl
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) # SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) open (IN,"ktest.pl");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) while (<IN>) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) # hashes are now used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) if (/\$opt\{"?([A-Z].*?)(\[.*\])?"?\}/ ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) /^\s*"?([A-Z].*?)"?\s*=>\s*/ ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) /set_test_option\("(.*?)"/) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) $opt{$1} = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) close IN;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) open (IN, "sample.conf");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) while (<IN>) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) if (/^\s*#?\s*([A-Z]\S*)\s*=/) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) $samp{$1} = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) close IN;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) foreach $opt (keys %opt) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) if (!defined($samp{$opt})) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) print "opt = $opt\n";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) foreach $samp (keys %samp) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) if (!defined($opt{$samp})) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) print "samp = $samp\n";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) }