Beispiel #1
0
def test_cppunit_no_report(mockplan):

    binary_path = os.path.join(fixture_root, "error", "runTests.sh")

    mockplan.add(
        Cppunit(name="My Cppunit", binary=binary_path, file_output_flag="-y"))

    assert mockplan.run().run is True
    assert mockplan.report.status == Status.ERROR
    assert "FileNotFoundError" in mockplan.report.flattened_logs[-1]["message"]
Beispiel #2
0
def main(plan):

    if not os.path.exists(BINARY_PATH):
        raise RuntimeError("You need to compile test binary first.")

    else:
        plan.add(
            Cppunit(name="My Cppunit",
                    binary=BINARY_PATH,
                    file_output_flag="-y"))
Beispiel #3
0
def test_cppunit(mockplan, binary_dir, expected_report, report_status):

    binary_path = os.path.join(binary_dir, "runTests")

    if not os.path.exists(binary_path):
        msg = BINARY_NOT_FOUND_MESSAGE.format(binary_dir=binary_dir,
                                              binary_path=binary_path)
        pytest.skip(msg)

    mockplan.add(Cppunit(name="My Cppunit", binary=binary_path))

    assert mockplan.run().run is True

    check_report(expected=expected_report, actual=mockplan.report)

    assert mockplan.report.status == report_status