| # Copyright 2018 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/components.gni") |
| import("//build/fuzz.gni") |
| import("//build/testing/environments.gni") |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ |
| ":cmx-fuzzers", |
| ":cmx_tests", |
| "facet_parser:tests", |
| ] |
| } |
| |
| source_set("cmx") { |
| sources = [ |
| "cmx.cc", |
| "cmx.h", |
| "program.cc", |
| "program.h", |
| "runtime.cc", |
| "runtime.h", |
| "sandbox.cc", |
| "sandbox.h", |
| ] |
| |
| deps = [ |
| "//sdk/lib/fit", |
| "//src/lib/cmx/facet_parser:cmx_facet_parser", |
| "//src/lib/fxl", |
| "//src/lib/json_parser", |
| "//src/lib/pkg_url", |
| "//third_party/rapidjson", |
| "//third_party/re2", |
| "//zircon/system/ulib/trace", |
| ] |
| } |
| |
| executable("cmx_unittests") { |
| testonly = true |
| |
| sources = [ |
| "cmx_unittest.cc", |
| "program_unittest.cc", |
| "runtime_unittest.cc", |
| "sandbox_unittest.cc", |
| ] |
| |
| deps = [ |
| ":cmx", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/json_parser", |
| "//src/lib/pkg_url", |
| "//src/lib/testing/loop_fixture", |
| "//third_party/googletest:gmock", |
| "//third_party/rapidjson", |
| ] |
| } |
| |
| fuchsia_unittest_package("cmx_tests") { |
| deps = [ |
| ":cmx_unittests", |
| "//src/sys/test_runners:tmp_storage", |
| ] |
| test_specs = { |
| environments = [ emu_env ] |
| } |
| } |
| |
| fuchsia_fuzzer_component("cmx-fuzzer-component") { |
| manifest = "meta/cmx_fuzzer.cml" |
| deps = [ ":cmx_fuzzer" ] |
| } |
| |
| fuchsia_fuzzer_package("cmx-fuzzers") { |
| cpp_fuzzer_components = [ ":cmx-fuzzer-component" ] |
| } |
| |
| fuchsia_library_fuzzer("cmx_fuzzer") { |
| sources = [ "cmx_fuzztest.cc" ] |
| deps = [ |
| ":cmx", |
| "//src/lib/files", |
| "//third_party/rapidjson", |
| ] |
| public_deps = [ |
| "//src/lib/fxl", |
| "//src/lib/json_parser", |
| ] |
| } |