Skip to content

Commit e28308d

Browse files
committed
tests: Introduce NotListed to handle tests not listed in the regression file
1 parent 0a58cdd commit e28308d

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed

src/deqp/tests/info.volt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn printResultsToStdout(suites: Suite[])
2020
test.printRegression();
2121
} else if (test.hasQualityChange()) {
2222
test.printAnyChange();
23-
} else if (test.hasAnyChange()) {
23+
} else if (test.hasAnyChangeExceptNotListed()) {
2424
test.printAnyChange();
2525
} else if (test.hasFailed()) {
2626
test.printFail();
@@ -90,5 +90,6 @@ fn format(res: Result) string
9090
case QualityWarning: return "\u001b[33mQualityWarning\u001b[0m";
9191
case CompatibilityWarning: return "\u001b[33mCompatibilityWarning\u001b[0m";
9292
case Pass: return "\u001b[32mPass\u001b[0m";
93+
case NotListed: return "\u001b[32mNotListed\u001b[0m";
9394
}
9495
}

src/deqp/tests/parser.volt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ fn parseAndCheckRegressions(suites: Suite[], filenames: string[]) i32
126126
database: Test[string];
127127
foreach (suite; suites) {
128128
foreach (test; suite.tests) {
129+
test.compare = Result.NotListed;
129130
database[test.name] = test;
130131
}
131132
}

src/deqp/tests/result.volt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ enum Result
2323
QualityWarning,
2424
CompatibilityWarning,
2525
Pass,
26+
NotListed, //< For compare, the test wasn't in the regression file.
2627
}
2728

2829
fn isResultPassing(result: Result) bool
@@ -37,6 +38,7 @@ fn isResultPassing(result: Result) bool
3738
case QualityWarning: return true;
3839
case CompatibilityWarning: return true;
3940
case Pass: return true;
41+
case NotListed: return true;
4042
}
4143
}
4244

@@ -52,6 +54,7 @@ fn isResultFailing(result: Result) bool
5254
case QualityWarning: return false;
5355
case CompatibilityWarning: return false;
5456
case Pass: return false;
57+
case NotListed: return false;
5558
}
5659
}
5760

@@ -75,13 +78,30 @@ fn isResultAndCompareRegression(result: Result, compare: Result) bool
7578

7679
fn isResultAndCompareQualityChange(result: Result, compare: Result) bool
7780
{
81+
if (compare == Result.NotListed) {
82+
compare = Result.Pass;
83+
}
84+
7885
if (result.isResultPassing() && compare.isResultPassing()) {
7986
return result != compare;
8087
} else {
8188
return false;
8289
}
8390
}
8491

92+
fn isResultAndCompareAnyChangeExceptNotListed(result: Result, compare: Result) bool
93+
{
94+
if (compare == Result.NotListed) {
95+
return false;
96+
}
97+
98+
if (result != compare) {
99+
return true;
100+
} else {
101+
return false;
102+
}
103+
}
104+
85105
fn isResultAndCompareAnyChange(result: Result, compare: Result) bool
86106
{
87107
if (result != compare) {
@@ -161,6 +181,7 @@ public:
161181
case CompatibilityWarning: numCompatibilityWarning++; break;
162182
case Pass: numPass++; break;
163183
case NotSupported: numNotSupported++; break;
184+
case NotListed: break;
164185
}
165186
}
166187
}

src/deqp/tests/test.volt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ public:
5959
return isResultAndCompareAnyChange(result, compare);
6060
}
6161

62+
fn hasAnyChangeExceptNotListed() bool
63+
{
64+
65+
return isResultAndCompareAnyChangeExceptNotListed(result, compare);
66+
}
67+
6268
fn hasPassed() bool
6369
{
6470
return isResultPassing(result);

0 commit comments

Comments
 (0)