Skip to content

Commit

Permalink
temporary change to run_tests.py to test error
Browse files Browse the repository at this point in the history
  • Loading branch information
klingbolt committed Jan 25, 2025
1 parent aa8b76f commit 9f2dfc8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions xml_converter/integration_tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

# Path to compiled C++ executable
xml_converter_binary_path: str = "../build/xml_converter"
test_xml_converter_binary_path: str = "../build/test_xml_converter"


def run_xml_converter(
Expand Down Expand Up @@ -44,6 +45,12 @@ def run_xml_converter(

return (result.stdout, result.stderr, result.returncode)

def run_gtest() -> Tuple[str, str, int]:
cmd: List[str] = [test_xml_converter_binary_path]
result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)

return (result.stdout, result.stderr, result.returncode)


def compare_text_files(file_path1: str, file_path2: str) -> List[str]:
with open(file_path1, 'r') as file1:
Expand Down Expand Up @@ -226,6 +233,12 @@ def main() -> bool:
all_tests_passed &= testcase_passed
test_run_count += 1

rawstdout, rawstderr, returncode = run_gtest()
if "[ FAILED ]" in rawstdout or args.verbose:
print(rawstdout)
else:
print(f"All GTEST passed")

if test_run_count == 0:
print("No Tests Were Run")
return False
Expand Down

0 comments on commit 9f2dfc8

Please sign in to comment.