Skip to content

Commit b09d91b

Browse files
committed
Ensure test assertions are run for excluded files
Previously, if a file was excluded, the test's output wouldn't be checked. This uncovered a missing C++ header extension used by the cidentlist tests.
1 parent bfd83b4 commit b09d91b

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

.styleguide

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
cppHeaderFileInclude {
22
\.h$
3+
\.hpp$
34
\.inc$
45
}
56

wpiformat/wpiformat/test/tasktest.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ def run(self, output_type):
9292
sys.stdout.seek(0)
9393
output = sys.stdout.read()
9494
sys.stdout = saved_stdout
95+
else:
96+
output = self.inputs[i][1]
97+
success = True
9598

96-
assert output == self.outputs[i][0]
97-
assert success == self.outputs[i][2]
99+
assert output == self.outputs[i][0]
100+
assert success == self.outputs[i][2]

wpiformat/wpiformat/test/test_licenseupdate.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,7 @@ def test_licenseupdate():
173173
"./Excluded.h",
174174
"/* Copyright (c) Company Name 2011-{}. */".format(year) + os.linesep +
175175
os.linesep + file_appendix)
176-
test.add_output(
177-
"/* Copyright (c) Company Name 2011-{}. */".format(year) + os.linesep +
178-
os.linesep + file_appendix, False, True)
176+
test.add_latest_input_as_output(True)
179177

180178
# Ensure license regex matches
181179
test.add_input("./Test.h",

0 commit comments

Comments
 (0)