# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//testing/libfuzzer/fuzzer_test.gni")

source_set("crash_keys") {
  sources = [ "crash_key_name.h" ]
}

static_library("common") {
  sources = [
    "allocation_info.cc",
    "allocation_info.h",
    "allocator_state.cc",
    "allocator_state.h",
    "extreme_lightweight_detector_util.h",
    "lightweight_detector_state.cc",
    "lightweight_detector_state.h",
    "pack_stack_trace.cc",
    "pack_stack_trace.h",
  ]

  deps = [
    ":crash_keys",
    "//base",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "allocator_state_unittest.cc",
    "lightweight_detector_state_unittest.cc",
    "pack_stack_trace_unittest.cc",
  ]
  deps = [
    ":common",
    "//base/test:test_support",
    "//testing/gtest",
  ]
}

fuzzer_test("pack_stack_trace_unpack_fuzzer") {
  sources = [ "pack_stack_trace_unpack_fuzzer.cc" ]
  deps = [
    "//base",
    "//components/gwp_asan/common",
  ]
}

fuzzer_test("pack_stack_trace_differential_fuzzer") {
  sources = [ "pack_stack_trace_differential_fuzzer.cc" ]
  deps = [
    "//base",
    "//components/gwp_asan/common",
  ]
}
