| # 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") |
| |
| # Test `run` with a stubbed launcher implementation |
| executable("run_tests_bin") { |
| testonly = true |
| output_name = "run_tests" |
| |
| sources = [ "run_tests.cc" ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.sys", |
| "//sdk/lib/fdio", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/sys/cpp/testing:unit", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/storage/vfs/cpp", |
| "//third_party/googletest:gtest", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| # Test `run` from the platform's perspective, using a real launcher |
| executable("run_return_value_test_bin") { |
| testonly = true |
| |
| output_name = "run_return_value_test" |
| |
| sources = [ "run_return_value_test.cc" ] |
| |
| deps = [ |
| "//sdk/lib/fdio", |
| "//src/lib/files", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/zircon/lib/zircon", |
| ] |
| } |
| |
| # Helper program for tests |
| executable("run_test_exiter_bin") { |
| output_name = "run_test_exiter" |
| |
| sources = [ "exiter.cc" ] |
| |
| deps = [ "//zircon/system/ulib/zx" ] |
| } |
| |
| fuchsia_component("run_test_exiter") { |
| testonly = true |
| manifest = "meta/run_test_exiter.cmx" |
| deps = [ ":run_test_exiter_bin" ] |
| } |
| |
| fuchsia_component("run_return_value_test") { |
| testonly = true |
| manifest = "meta/run_return_value_test.cmx" |
| deps = [ |
| ":run_return_value_test_bin", |
| "//src/sys/tools/run:bin", |
| ] |
| } |
| |
| fuchsia_component("run_tests") { |
| testonly = true |
| manifest = "meta/run_tests.cmx" |
| deps = [ ":run_tests_bin" ] |
| } |
| |
| fuchsia_test_package("run_tests_pkg") { |
| package_name = "run_tests" |
| |
| test_components = [ |
| ":run_return_value_test", |
| ":run_tests", |
| ] |
| |
| deps = [ ":run_test_exiter" ] |
| } |
| |
| group("test") { |
| testonly = true |
| deps = [ ":run_tests_pkg" ] |
| } |