From c19f427ce152cc8bb806baa6877457380813a82b Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 10 Jul 2013 14:35:25 -0700 Subject: update tester for new gpu_table.txt format --- scripts/gpu_table_tester | 67 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 21 deletions(-) (limited to 'scripts/gpu_table_tester') diff --git a/scripts/gpu_table_tester b/scripts/gpu_table_tester index 9bc958636d..339823246c 100755 --- a/scripts/gpu_table_tester +++ b/scripts/gpu_table_tester @@ -46,8 +46,8 @@ my $mini_HELP = " $MyName {--gpu-table|-g} {--diff|-d} [ ...] With the --diff option, the report compares the current results to , - which should be the output from a previous run without --diff. The report shows each - input value with the old result and the new result if it is different. + which should be the output from a previous run without --diff. The report shows + each input value with the old result and the new result if they are different. "; &GetOptions("help" => \$Help @@ -81,11 +81,15 @@ my %Recognizer; # name -> recognizer my %Class; # recognizer -> class my %Supported; # recognizer -> supported my @InOrder; # lowercased recognizers in file order - these are the ones really used to match +my %StatsBased; +my %ExpectedOpenGL; $Name{$NoMatch} = $NoMatch; $NameLine{$NoMatch} = '(hard-coded)'; # use this for error messages in table parsing $Class{$NoMatch} = ''; $Supported{$NoMatch} = ''; +$StatsBased{$NoMatch} = ''; +$ExpectedOpenGL{$NoMatch} = ''; while () { @@ -93,7 +97,7 @@ while () next if m|^\s*$|; # skip blank lines chomp; - my ($name, $regex, $class, $supported, $extra) = split('\t+'); + my ($name, $regex, $class, $supported, $stats_based, $expected_opengl, $extra) = split('\t+'); my $errsOnLine = $ErrorsSeen; if (!$name) { @@ -119,7 +123,7 @@ while () print STDERR " $INPUT_LINE_NUMBER: name '$name' " . ($supported ? "supported" : "unsupported") . " class $class - ignored\n"; $ErrorsSeen++; } - if ($class !~ m/[0123]/) + if ($class !~ m/[012345]/) { print STDERR "Invalid class value '$class' on $GpuTable line $INPUT_LINE_NUMBER\n"; $ErrorsSeen++; @@ -129,6 +133,16 @@ while () print STDERR "Invalid supported value '$supported' on $GpuTable line $INPUT_LINE_NUMBER\n"; $ErrorsSeen++; } + if ($stats_based !~ m/[01]/) + { + print STDERR "Invalid stats_based value '$stats_based' on $GpuTable line $INPUT_LINE_NUMBER\n"; + $ErrorsSeen++; + } + if ($expected_opengl !~ m/\d+(\.\d+)?/) + { + print STDERR "Invalid expected_opengl value '$expected_opengl' on $GpuTable line $INPUT_LINE_NUMBER\n"; + $ErrorsSeen++; + } if ($extra) { print STDERR "Extra data '$extra' on $GpuTable line $INPUT_LINE_NUMBER\n"; @@ -144,6 +158,8 @@ while () $Recognizer{$name} = $regex; $Class{$regex} = $class; $Supported{$regex} = $supported ? "supported" : "unsupported"; + $StatsBased{$regex} = $stats_based; + $ExpectedOpenGL{$regex} = $expected_opengl; } } @@ -174,27 +190,27 @@ while (<>) } format STDOUT_TOP = -GPU String Supported? Class Recognizer ------------------------------------------------------------------------------------------------------- ----------- ----- ------------------------------------ +GPU String Supported? Class Stats OpenGL Recognizer +------------------------------------------------------------------------------------------------------ ----------- ----- ----- ------ ------------------------------------ . format STDOUT = -@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... @<<<<<<<<<< @> @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... -$_, $Supported{$RecognizedBy{$_}},$Class{$RecognizedBy{$_}},$Name{$RecognizedBy{$_}} +@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... @<<<<<<<<<< @> @> @<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... +$_, $Supported{$RecognizedBy{$_}},$Class{$RecognizedBy{$_}},$StatsBased{$RecognizedBy{$_}},$ExpectedOpenGL{$RecognizedBy{$_}},$Name{$RecognizedBy{$_}} . -my $ReportLineTemplate = "A102xxxA12xxxAA*"; # MUST match the format STDOUT above +my $ReportLineTemplate = "A102xxxA12xxxA2xxxxA2xxxxA5A*"; # MUST match the format STDOUT above format DIFF_TOP = - ------ OLD ------ ------ NEW ------ -GPU String Supported? Class Supported? Class ------------------------------------------------------------------------------------------------------- ----------- ----- ----------- ----- + ------------- OLD ------------- ----------- NEW --------------- +GPU String Supported? Class Stats OpenGL Supported? Class Stats OpenGL +------------------------------------------------------------------------------------------------------ ----------- ----- ----- ------ ----------- ----- ----- ------ . my ( $oldSupported, $oldClass, $newSupported, $newClass ); format DIFF = -@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... @<<<<<<<<<< @> @<<<<<<<<<< @> -$_, $oldSupported, $oldClass, $newSupported, $newClass +@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... @<<<<<<<<<< @> @> @<<<< @<<<<<<<<<< @> @> @<<<< +$_, $oldSupported, $oldClass, $oldStatsBased, $oldExpectedOpenGL, $newSupported, $newClass, $newStatsBased, $newExpectedOpenGL . if ( ! $Diff ) @@ -215,12 +231,14 @@ else my $discard = 2; while ( ) { - if ( $discard > 0 ) + if ( $discard <= 0 ) { - my ( $gpu, $supported, $class ) = unpack $ReportLineTemplate; + my ( $gpu, $supported, $class, $stats, $opengl ) = unpack $ReportLineTemplate; $gpu =~ s/\s*$//; ( $OldSupported{$gpu} = $supported ) =~ s/\s*$//; ( $OldClass{$gpu} = $class ) =~ s/\s*$//; + ( $OldStatsBased{$gpu} = $stats ) =~ s/\s*$//; + ( $OldExpectedOpenGL{$gpu} = $opengl ) =~ s/\s*$//; } else { @@ -235,26 +253,33 @@ else { $newSupported = $Supported{$RecognizedBy{$_}} || $NoMatch; $newClass = $Class{$RecognizedBy{$_}}; + $newStatsBased = $StatsBased{$RecognizedBy{$_}}; + $newExpectedOpenGL = $ExpectedOpenGL{$RecognizedBy{$_}}; if ( ! defined $OldSupported{$_} ) { $oldSupported = 'NEW'; $oldClass = '-'; + $oldStatsBased = '-'; + $oldExpectedOpenGL = '-'; + write; } else { $oldSupported = $OldSupported{$_} || $NoMatch; $oldClass = $OldClass{$_}; + $oldStatsBased = $OldStatsBased{$_}; + $oldExpectedOpenGL = $OldExpectedOpenGL{$_}; - if ( ( $oldSupported eq $newSupported ) - && ( $oldClass eq $newClass ) + if ( ( $oldSupported ne $newSupported ) + || ( $oldClass ne $newClass ) + || ( $oldStatsBased ne $newStatsBased ) + || ( $oldExpectedOpenGL ne $newExpectedOpenGL ) ) { - $newSupported = ''; - $newClass = ''; + write; } } - write; $-++; # suppresses pagination } } -- cgit v1.2.3 From 4ae06c7e3340e09ffe6b54dccd4faeb210330d7e Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 7 Aug 2013 18:03:16 -0400 Subject: add line number of recognizer to diff report --- scripts/gpu_table_tester | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'scripts/gpu_table_tester') diff --git a/scripts/gpu_table_tester b/scripts/gpu_table_tester index 339823246c..76994da1aa 100755 --- a/scripts/gpu_table_tester +++ b/scripts/gpu_table_tester @@ -201,16 +201,16 @@ $_, $Supported{$RecognizedBy{$_}},$Class{$RecognizedBy{$_}},$StatsBased{$Recogni my $ReportLineTemplate = "A102xxxA12xxxA2xxxxA2xxxxA5A*"; # MUST match the format STDOUT above format DIFF_TOP = - ------------- OLD ------------- ----------- NEW --------------- -GPU String Supported? Class Stats OpenGL Supported? Class Stats OpenGL ------------------------------------------------------------------------------------------------------- ----------- ----- ----- ------ ----------- ----- ----- ------ + ------------- OLD ------------- ----------- NEW -------------------- +GPU String Supported? Class Stats OpenGL Supported? Class Stats OpenGL Line +------------------------------------------------------------------------------------------------------ ----------- ----- ----- ------ ----------- ----- ----- ------ ----- . my ( $oldSupported, $oldClass, $newSupported, $newClass ); format DIFF = -@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... @<<<<<<<<<< @> @> @<<<< @<<<<<<<<<< @> @> @<<<< -$_, $oldSupported, $oldClass, $oldStatsBased, $oldExpectedOpenGL, $newSupported, $newClass, $newStatsBased, $newExpectedOpenGL +@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... @<<<<<<<<<< @> @> @<<<< @<<<<<<<<<< @> @> @<<<< @>>>> +$_, $oldSupported, $oldClass, $oldStatsBased, $oldExpectedOpenGL, $newSupported, $newClass, $newStatsBased, $newExpectedOpenGL, $newRecognizedLine . if ( ! $Diff ) @@ -255,6 +255,7 @@ else $newClass = $Class{$RecognizedBy{$_}}; $newStatsBased = $StatsBased{$RecognizedBy{$_}}; $newExpectedOpenGL = $ExpectedOpenGL{$RecognizedBy{$_}}; + $newRecognizedLine = $RecognizerLine{$RecognizedBy{$_}}; if ( ! defined $OldSupported{$_} ) { -- cgit v1.2.3 From e51e79c4d4147f89304a03ef5ee9ec4dfe886d52 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 7 Aug 2013 18:04:03 -0400 Subject: truncate gpu id strings to 100 characters (avoids diff problems) --- scripts/gpu_table_tester | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts/gpu_table_tester') diff --git a/scripts/gpu_table_tester b/scripts/gpu_table_tester index 76994da1aa..6989e6f968 100755 --- a/scripts/gpu_table_tester +++ b/scripts/gpu_table_tester @@ -175,6 +175,7 @@ my %RecognizedBy; while (<>) { chomp; + $_ = substr($_,0,100); my $lcInput = lc $_; # the real gpu table parser lowercases the input string my $recognizer; $RecognizedBy{$_} = $NoMatch; -- cgit v1.2.3 From d5c9b7b8e5ea81ae6f3d7ca7f67d527c2f7e5ef4 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 29 Aug 2013 09:56:44 -0400 Subject: fix header display for diff report --- scripts/gpu_table_tester | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'scripts/gpu_table_tester') diff --git a/scripts/gpu_table_tester b/scripts/gpu_table_tester index 6989e6f968..4ce08e3005 100755 --- a/scripts/gpu_table_tester +++ b/scripts/gpu_table_tester @@ -195,30 +195,27 @@ GPU String ------------------------------------------------------------------------------------------------------ ----------- ----- ----- ------ ------------------------------------ . format STDOUT = -@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... @<<<<<<<<<< @> @> @<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... +@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<< @> @> @<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... $_, $Supported{$RecognizedBy{$_}},$Class{$RecognizedBy{$_}},$StatsBased{$RecognizedBy{$_}},$ExpectedOpenGL{$RecognizedBy{$_}},$Name{$RecognizedBy{$_}} . -my $ReportLineTemplate = "A102xxxA12xxxA2xxxxA2xxxxA5A*"; # MUST match the format STDOUT above +my $ReportLineTemplate = "A102xxxA12xxxA2xxxxA2xxxxA5A*"; # Used to read a previous report - MUST match the format STDOUT above + +my ( $oldSupported, $oldClass, $newSupported, $newClass ); format DIFF_TOP = ------------- OLD ------------- ----------- NEW -------------------- GPU String Supported? Class Stats OpenGL Supported? Class Stats OpenGL Line ------------------------------------------------------------------------------------------------------ ----------- ----- ----- ------ ----------- ----- ----- ------ ----- -. - -my ( $oldSupported, $oldClass, $newSupported, $newClass ); - +. format DIFF = -@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... @<<<<<<<<<< @> @> @<<<< @<<<<<<<<<< @> @> @<<<< @>>>> -$_, $oldSupported, $oldClass, $oldStatsBased, $oldExpectedOpenGL, $newSupported, $newClass, $newStatsBased, $newExpectedOpenGL, $newRecognizedLine +@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<< @> @> @<<<< @<<<<<<<<<< @> @> @<<<< @>>>> +$_, $oldSupported, $oldClass, $oldStatsBased, $oldExpectedOpenGL, $newSupported, $newClass, $newStatsBased, $newExpectedOpenGL, $newRecognizedLine . if ( ! $Diff ) { - ## Print results. - ## For each input, show supported or unsupported, the class, and the recognizer name - + ## Print results of testing each input line and how it was recognized. foreach ( sort keys %RecognizedBy ) { write if ! $UnMatchedOnly || $Name{$RecognizedBy{$_}} eq $NoMatch; @@ -227,6 +224,7 @@ if ( ! $Diff ) } else { + ## Print a comparison of how the recognition this time compared to the results from the $Diff file open OLD, "<$Diff" || die "Failed to open --diff file '$Diff'\n\t$!\n"; my $discard = 2; @@ -248,8 +246,8 @@ else } close OLD; - $FORMAT_TOP_NAME = DIFF_TOP; - $FORMAT_NAME = DIFF; + $FORMAT_TOP_NAME = 'DIFF_TOP'; + $FORMAT_NAME = 'DIFF'; foreach ( sort keys %RecognizedBy ) { $newSupported = $Supported{$RecognizedBy{$_}} || $NoMatch; @@ -265,6 +263,7 @@ else $oldStatsBased = '-'; $oldExpectedOpenGL = '-'; write; + $-++; # suppresses pagination } else { @@ -280,9 +279,10 @@ else ) { write; + $-++; # suppresses pagination } } - $-++; # suppresses pagination + } } -- cgit v1.2.3