| # 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/package.gni") |
| |
| # Test `run` with a stubbed launcher implementation |
| executable("bin") { |
| testonly = true |
| output_name = "run_tests" |
| |
| sources = [ |
| "run_tests.cc", |
| ] |
| |
| deps = [ |
| "//garnet/public/fidl/fuchsia.sys", |
| "//garnet/public/lib/component/cpp", |
| "//garnet/public/lib/component/cpp/testing:fake_launcher", |
| "//garnet/public/lib/fidl/cpp", |
| "//garnet/public/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/fs", |
| ] |
| } |
| |
| # Test `run` from the platform's perspective, using a real launcher |
| executable("run_return_value_test") { |
| testonly = true |
| |
| output_name = "run_return_value_test" |
| |
| sources = [ |
| "run_return_value_test.cc", |
| ] |
| |
| libs = [ "zircon" ] |
| |
| deps = [ |
| "//garnet/public/lib/fxl/test:gtest_main", |
| "//zircon/public/lib/fdio", |
| ] |
| } |
| |
| # Test `run` from the shell's perspective |
| copy("run_return_value_shell_test") { |
| sources = [ |
| "run_return_value_shell_test", |
| ] |
| |
| outputs = [ |
| "$root_out_dir/run_return_value_shell_test", |
| ] |
| } |
| |
| # Helper program for tests |
| executable("exiter_bin") { |
| output_name = "run_test_exiter" |
| |
| sources = [ |
| "exiter.cc", |
| ] |
| |
| deps = [ |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| # Helper program for tests |
| package("run_test_exiter") { |
| meta = [ |
| { |
| path = "meta/run_test_exiter.cmx" |
| dest = "run_test_exiter.cmx" |
| }, |
| ] |
| |
| deps = [ |
| ":exiter_bin", |
| ] |
| |
| binary = "run_test_exiter" |
| } |
| |
| package("run_tests") { |
| testonly = true |
| |
| deps = [ |
| ":bin", |
| ":run_return_value_shell_test", |
| ":run_return_value_test", |
| ] |
| |
| meta = [ |
| { |
| dest = "run_return_value_shell_test.cmx" |
| path = rebase_path(dest) |
| }, |
| { |
| dest = "run_return_value_test.cmx" |
| path = rebase_path(dest) |
| }, |
| ] |
| |
| tests = [ |
| { |
| name = "run_return_value_test" |
| }, |
| { |
| name = "run_return_value_shell_test" |
| }, |
| { |
| name = "run_tests" |
| }, |
| ] |
| } |