示例#1
0
def test_ResultIsInteresting_unknown():
    """An unknown outcome is not interesting."""
    gs_harness = MockHarness()
    filters = MockFilters()
    result = opencl_fuzz.ResultIsInteresting(
        deepsmith_pb2.Result(outcome=deepsmith_pb2.Result.UNKNOWN),
        difftests.UnaryTester(),
        difftests.GoldStandardDiffTester(
            difftests.NamedOutputIsEqual('stdout')), gs_harness, filters)
    assert not result
    # Only the unary tester was called, no differential test was required.
    assert not gs_harness.RunTestcases_call_requests
    assert len(filters.PreDifftest_call_args) == 0
示例#2
0
def test_ResultIsInteresting_build_timeout():
    """A build timeout is interesting."""
    gs_harness = MockHarness()
    filters = MockFilters()
    result = opencl_fuzz.ResultIsInteresting(
        deepsmith_pb2.Result(outcome=deepsmith_pb2.Result.BUILD_TIMEOUT),
        difftests.UnaryTester(),
        difftests.GoldStandardDiffTester(
            difftests.NamedOutputIsEqual('stdout')), gs_harness, filters)
    assert result
    assert result.outputs['difftest_outcome'] == 'ANOMALOUS_BUILD_FAILURE'
    # Only the unary tester was called, no differential test was required.
    assert not gs_harness.RunTestcases_call_requests
    assert len(filters.PreDifftest_call_args) == 0
示例#3
0
def test_ResultIsInteresting_build_crash():
  """A build crash is interesting."""
  gs_harness = MockHarness()
  filters = MockFilters()
  result = opencl_fuzz.ResultIsInteresting(
    deepsmith_pb2.Result(outcome=deepsmith_pb2.Result.BUILD_CRASH),
    difftests.UnaryTester(),
    difftests.GoldStandardDiffTester(difftests.NamedOutputIsEqual("stdout")),
    gs_harness,
    filters,
  )
  assert result
  assert result.outputs["difftest_outcome"] == "ANOMALOUS_BUILD_FAILURE"
  # Only the unary tester was called, no differential test was required.
  assert not gs_harness.RunTestcases_call_requests
  assert len(filters.PreDifftest_call_args) == 0