| # Copyright 2019 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") | |
| source_set("test_suite_lib") { | |
| sources = [ | |
| "test_suite.cc", | |
| "test_suite.h", | |
| ] | |
| public_deps = [ | |
| "//sdk/fidl/fuchsia.test", | |
| "//src/lib/fxl", | |
| "//zircon/public/lib/async-loop-cpp", | |
| "//zircon/public/lib/async-loop-default", | |
| ] | |
| } | |
| executable("passing-test-example") { | |
| deps = [ | |
| ":test_suite_lib", | |
| "//sdk/lib/sys/cpp", | |
| "//zircon/public/lib/async-loop-cpp", | |
| "//zircon/public/lib/async-loop-default", | |
| ] | |
| sources = [ | |
| "passing_test_example.cc", | |
| ] | |
| } | |
| executable("failing-test-example") { | |
| deps = [ | |
| ":test_suite_lib", | |
| "//sdk/lib/sys/cpp", | |
| "//zircon/public/lib/async-loop-cpp", | |
| "//zircon/public/lib/async-loop-default", | |
| ] | |
| sources = [ | |
| "failing_test_example.cc", | |
| ] | |
| } | |
| executable("incomplete-test-example") { | |
| deps = [ | |
| ":test_suite_lib", | |
| "//sdk/lib/sys/cpp", | |
| "//zircon/public/lib/async-loop-cpp", | |
| ] | |
| sources = [ | |
| "incomplete_test_example.cc", | |
| ] | |
| } | |
| executable("invalid-test-example") { | |
| deps = [ | |
| ":test_suite_lib", | |
| "//sdk/lib/sys/cpp", | |
| "//zircon/public/lib/async-loop-cpp", | |
| ] | |
| sources = [ | |
| "invalid_test_example.cc", | |
| ] | |
| } | |
| executable("no-test-example") { | |
| deps = [ | |
| ":test_suite_lib", | |
| "//sdk/lib/sys/cpp", | |
| "//zircon/public/lib/async-loop-cpp", | |
| "//zircon/public/lib/async-loop-default", | |
| ] | |
| sources = [ | |
| "no_test_example.cc", | |
| ] | |
| } | |
| executable("get-tests-hangs-example") { | |
| deps = [ | |
| ":test_suite_lib", | |
| "//sdk/lib/sys/cpp", | |
| "//zircon/public/lib/async-loop-cpp", | |
| "//zircon/public/lib/async-loop-default", | |
| ] | |
| sources = [ | |
| "get_tests_hangs_example.cc", | |
| ] | |
| } | |
| executable("get-tests-closes-channel-example") { | |
| deps = [ | |
| ":test_suite_lib", | |
| "//sdk/lib/sys/cpp", | |
| "//zircon/public/lib/async-loop-cpp", | |
| "//zircon/public/lib/async-loop-default", | |
| ] | |
| sources = [ | |
| "get_tests_closes_channel_example.cc", | |
| ] | |
| } | |
| executable("run-hangs-example") { | |
| deps = [ | |
| ":test_suite_lib", | |
| "//sdk/lib/sys/cpp", | |
| "//zircon/public/lib/async-loop-cpp", | |
| "//zircon/public/lib/async-loop-default", | |
| ] | |
| sources = [ | |
| "run_hangs_example.cc", | |
| ] | |
| } | |
| executable("run-closes-channel-example") { | |
| deps = [ | |
| ":test_suite_lib", | |
| "//sdk/lib/sys/cpp", | |
| "//zircon/public/lib/async-loop-cpp", | |
| "//zircon/public/lib/async-loop-default", | |
| ] | |
| sources = [ | |
| "run_closes_channel_example.cc", | |
| ] | |
| } | |
| group("all_bins") { | |
| public_deps = [ | |
| ":failing-test-example", | |
| ":get-tests-closes-channel-example", | |
| ":get-tests-hangs-example", | |
| ":incomplete-test-example", | |
| ":invalid-test-example", | |
| ":no-test-example", | |
| ":passing-test-example", | |
| ":run-closes-channel-example", | |
| ":run-hangs-example", | |
| "rust:all_bins", | |
| "//examples/components/routing/echo_server", | |
| ] | |
| } | |
| package("example-tests") { | |
| testonly = true | |
| deps = [ | |
| ":all_bins", | |
| ] | |
| binaries = [ | |
| { | |
| name = "passing-test-example" | |
| }, | |
| { | |
| name = "no-test-example" | |
| }, | |
| { | |
| name = "failing-test-example" | |
| }, | |
| { | |
| name = "incomplete-test-example" | |
| }, | |
| { | |
| name = "get-tests-hangs-example" | |
| }, | |
| { | |
| name = "run-hangs-example" | |
| }, | |
| { | |
| name = "get-tests-closes-channel-example" | |
| }, | |
| { | |
| name = "run-closes-channel-example" | |
| }, | |
| { | |
| name = "invalid-test-example" | |
| }, | |
| { | |
| name = "echo_test_client" | |
| }, | |
| { | |
| name = "echo_server" | |
| }, | |
| ] | |
| tests = [ | |
| { | |
| name = "echo_test_realm" | |
| }, | |
| ] | |
| meta = [ | |
| { | |
| path = "meta/passing-test-example.cmx" | |
| dest = "passing-test-example.cmx" | |
| }, | |
| { | |
| path = "meta/passing-test-example_v2.cml" | |
| dest = "passing-test-example_v2.cm" | |
| }, | |
| { | |
| path = "meta/no-test-example.cmx" | |
| dest = "no-test-example.cmx" | |
| }, | |
| { | |
| path = "meta/failing-test-example.cmx" | |
| dest = "failing-test-example.cmx" | |
| }, | |
| { | |
| path = "meta/incomplete-test-example.cmx" | |
| dest = "incomplete-test-example.cmx" | |
| }, | |
| { | |
| path = "meta/get-tests-hangs-example.cmx" | |
| dest = "get-tests-hangs-example.cmx" | |
| }, | |
| { | |
| path = "meta/get-tests-closes-channel-example.cmx" | |
| dest = "get-tests-closes-channel-example.cmx" | |
| }, | |
| { | |
| path = "meta/run-closes-channel-example.cmx" | |
| dest = "run-closes-channel-example.cmx" | |
| }, | |
| { | |
| path = "meta/run-hangs-example.cmx" | |
| dest = "run-hangs-example.cmx" | |
| }, | |
| { | |
| path = "meta/invalid-test-example.cmx" | |
| dest = "invalid-test-example.cmx" | |
| }, | |
| { | |
| path = "meta/echo_test_realm.cml" | |
| dest = "echo_test_realm.cm" | |
| }, | |
| { | |
| path = "meta/echo_test_client.cml" | |
| dest = "echo_test_client.cm" | |
| }, | |
| { | |
| path = rebase_path("//examples/components/routing/meta/echo_server.cml") | |
| dest = "echo_server.cm" | |
| }, | |
| ] | |
| } | |
| group("tests") { | |
| testonly = true | |
| deps = [ | |
| ":example-tests", | |
| ] | |
| } |