def main(): test_cases, _ = gtest_fake_base.parse_args(TESTS, 0) for test_case in test_cases: print gtest_fake_base.get_test_output(test_case, False) print gtest_fake_base.get_footer(len(test_cases), len(test_cases)) return 1
def main(): test_cases, args = gtest_fake_base.parse_args(TESTS, 1) duration = int(args[0]) for i in test_cases: time.sleep(float(duration) / 1000.) print gtest_fake_base.get_test_output(i, False, duration=str(duration)) print gtest_fake_base.get_footer(len(test_cases), len(test_cases)) return 0
def main(): test_cases, _ = gtest_fake_base.parse_args(TESTS, 0) result = 0 for test_case in test_cases: # Make Baz.Fail fail. should_fail = test_case == 'Baz.Fail' result = result or int(should_fail) print gtest_fake_base.get_test_output(test_case, should_fail) print gtest_fake_base.get_footer(len(test_cases), len(test_cases)) return result
def main(): test_cases, args = gtest_fake_base.parse_args(TESTS, 1) temp_dir = args[0] result = 0 for test_case in test_cases: filename = os.path.join(temp_dir, test_case) # Fails on first run, succeeds on the second. should_fail = not os.path.isfile(filename) result = result or int(should_fail) print gtest_fake_base.get_test_output(test_case, should_fail) if should_fail: with open(filename, "wb") as f: f.write("bang") print gtest_fake_base.get_footer(len(test_cases), len(test_cases)) return result
def main(): test_cases, args = gtest_fake_base.parse_args(TESTS, 1) temp_dir = args[0] result = 0 for test_case in test_cases: filename = os.path.join(temp_dir, test_case) # Fails on first run, succeeds on the second. should_fail = not os.path.isfile(filename) result = result or int(should_fail) print gtest_fake_base.get_test_output(test_case, should_fail) if should_fail: with open(filename, 'wb') as f: f.write('bang') print gtest_fake_base.get_footer(len(test_cases), len(test_cases)) return result
def main(): test_cases, args = gtest_fake_base.parse_args(TESTS, 1) temp_dir = args[0] result = 0 for test_case in test_cases: filename = os.path.join(temp_dir, test_case) # Fails on first run, succeeds on the second. should_fail = not os.path.isfile(filename) # But it still prints it succeeded. print gtest_fake_base.get_test_output(test_case, False) result = result or int(should_fail) if should_fail: with open(filename, 'wb') as f: f.write('bang') print gtest_fake_base.get_footer(len(test_cases), len(test_cases)) if result: print('OMG I crashed') print('Here\'s a stack trace') return result
def main(): test_cases, args = gtest_fake_base.parse_args(TESTS, 1) temp_dir = args[0] result = 0 for test_case in test_cases: if test_case == "Foo.Bar2": # Never run it, don't fail either. continue should_fail = False if test_case == "Foo.Bar1": filename = os.path.join(temp_dir, test_case) should_fail = not os.path.isfile(filename) result = result or int(should_fail) print gtest_fake_base.get_test_output(test_case, should_fail) if should_fail: with open(filename, "wb") as f: f.write("bang") print gtest_fake_base.get_footer(len(test_cases), len(test_cases)) return result
def main(): test_cases, args = gtest_fake_base.parse_args(TESTS, 1) temp_dir = args[0] result = 0 for test_case in test_cases: if test_case == 'Foo.Bar2': # Never run it, don't fail either. continue should_fail = False if test_case == 'Foo.Bar1': filename = os.path.join(temp_dir, test_case) should_fail = not os.path.isfile(filename) result = result or int(should_fail) print gtest_fake_base.get_test_output(test_case, should_fail) if should_fail: with open(filename, 'wb') as f: f.write('bang') print gtest_fake_base.get_footer(len(test_cases), len(test_cases)) return result