Skip to content

Commit

Permalink
Ensure test assertions are run for excluded files (#196)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
calcmogul committed Dec 4, 2020
1 parent bfd83b4 commit 3372907
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions .styleguide
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cppHeaderFileInclude {
\.h$
\.hpp$
\.inc$
}

Expand Down
7 changes: 5 additions & 2 deletions wpiformat/wpiformat/test/tasktest.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ def run(self, output_type):
sys.stdout.seek(0)
output = sys.stdout.read()
sys.stdout = saved_stdout
else:
output = self.inputs[i][1]
success = True

assert output == self.outputs[i][0]
assert success == self.outputs[i][2]
assert output == self.outputs[i][0]
assert success == self.outputs[i][2]
2 changes: 1 addition & 1 deletion wpiformat/wpiformat/test/test_includeorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ def test_includeorder():

# Ensure lines containing #include that aren't includes are not processed
test.add_input("./Test.h", "// #included here" + os.linesep)
test.add_output("// #included here" + os.linesep, False, True)
test.add_latest_input_as_output(True)

# Ensure extra newline isn't inserted between #pragma and #ifdef
test.add_input("./Test.h",
Expand Down
4 changes: 1 addition & 3 deletions wpiformat/wpiformat/test/test_licenseupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,7 @@ def test_licenseupdate():
"./Excluded.h",
"/* Copyright (c) Company Name 2011-{}. */".format(year) + os.linesep +
os.linesep + file_appendix)
test.add_output(
"/* Copyright (c) Company Name 2011-{}. */".format(year) + os.linesep +
os.linesep + file_appendix, False, True)
test.add_latest_input_as_output(True)

# Ensure license regex matches
test.add_input("./Test.h",
Expand Down

0 comments on commit 3372907

Please sign in to comment.