Actually cause the comparator / test to fail when there is an error reading one

of the toolchains.

Cosmetic spacing fixes for strings that will be concatenated and fixed a typo.

PiperOrigin-RevId: 229961708
This commit is contained in:
Googler 2019-01-18 11:20:12 -08:00 committed by Copybara-Service
parent dc71ef6ea6
commit da4639bd1f
1 changed files with 4 additions and 3 deletions

View File

@ -77,7 +77,7 @@ def _read_crosstool_or_ctoolchain_proto(input_file, toolchain_identifier):
text_format.Merge(text, crosstool_release)
toolchain = _find_toolchain(crosstool_release, toolchain_identifier)
if toolchain is None:
print(("Cannnot find a CToolchain with an identifier '%s' in CROSSTOOL"
print(("Cannot find a CToolchain with an identifier '%s' in CROSSTOOL "
"file") % toolchain_identifier)
return None
return toolchain
@ -85,7 +85,7 @@ def _read_crosstool_or_ctoolchain_proto(input_file, toolchain_identifier):
try:
text_format.Merge(text, c_toolchain)
if c_toolchain.toolchain_identifier != toolchain_identifier:
print(("Expected CToolchain with identifier '%s', got CToolchain with"
print(("Expected CToolchain with identifier '%s', got CToolchain with "
"identifier '%s'" % (toolchain_identifier,
c_toolchain.toolchain_identifier)))
return None
@ -111,7 +111,8 @@ def main(unused_argv):
toolchain_identifier)
if not toolchain_before or not toolchain_after:
return
print("There was an error getting the required toolchains.")
exit(1)
found_difference = compare_ctoolchains(toolchain_before, toolchain_after)
if found_difference: