| # Copyright 2016 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") |
| import("//build/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":basic_integration_test_app", |
| ":integration_test_utils", |
| ":integration_test_utils_with_trace_with_static_engine", |
| ":nested_environment_test", |
| ":run_integration_test", |
| ":run_test", |
| ":self_contained_provider", |
| ":trace_integration_tests", |
| ":trace_tests", |
| ":trace_tests_bin", |
| ":two_providers_one_engine", |
| ":two_providers_two_engines_test_app", |
| ] |
| } |
| |
| source_set("component_context") { |
| testonly = true |
| |
| sources = [ |
| "component_context.cc", |
| "component_context.h", |
| ] |
| |
| deps = [ |
| "//src/lib/fxl", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/async-loop-default", |
| "//zircon/public/lib/zx", |
| ] |
| |
| public_deps = [ |
| "//garnet/public/lib/gtest", |
| "//sdk/lib/sys/cpp", |
| ] |
| } |
| |
| # Generic main entry point target for GTest executables. |
| # This augments src/lib/fxl/test by adding component context. |
| source_set("gtest_main") { |
| testonly = true |
| |
| sources = [ "gtest_main.cc" ] |
| |
| deps = [ |
| "//src/lib/fxl", |
| "//src/lib/fxl/test:test_settings", |
| ] |
| |
| public_deps = [ |
| ":component_context", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| executable("trace_tests_bin") { |
| testonly = true |
| |
| output_name = "trace_tests" |
| |
| deps = [ |
| ":gtest_main", |
| "//garnet/bin/trace:unittests", |
| "//garnet/lib/measure:unittests", |
| ] |
| |
| # TODO(46850): Fix the leaks and remove this. |
| deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ] |
| } |
| |
| source_set("run_test") { |
| testonly = true |
| |
| sources = [ |
| "run_test.cc", |
| "run_test.h", |
| ] |
| |
| public_deps = [ |
| "//sdk/lib/sys/cpp", |
| "//zircon/public/lib/zx", |
| ] |
| |
| deps = [ |
| ":component_context", |
| ":integration_test_utils", |
| "//garnet/bin/trace:spec", |
| "//src/developer/tracing/lib/test_utils", |
| "//src/lib/fxl", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/async-loop-default", |
| "//zircon/public/lib/fdio", |
| ] |
| } |
| |
| source_set("integration_test_utils") { |
| testonly = true |
| |
| sources = [ |
| "integration_test_utils.cc", |
| "integration_test_utils.h", |
| ] |
| |
| public_deps = [ |
| "//garnet/bin/trace:spec", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/trace-provider", |
| "//zircon/public/lib/zx", |
| ] |
| |
| deps = [ |
| "//src/lib/fxl", |
| "//third_party/rapidjson", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/trace", |
| "//zircon/system/ulib/trace-reader", |
| ] |
| } |
| |
| # Same as "integration_test_utils" except uses trace-with-static-engine. |
| # This is done in order to ensure trace-engine-static is used. |
| source_set("integration_test_utils_with_trace_with_static_engine") { |
| testonly = true |
| |
| defines = [ "USE_STATIC_ENGINE" ] |
| |
| sources = [ |
| "integration_test_utils.cc", |
| "integration_test_utils.h", |
| ] |
| |
| public_deps = [ |
| "//garnet/bin/trace:spec", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/trace-provider-with-static-engine", |
| "//zircon/public/lib/zx", |
| ] |
| |
| deps = [ |
| "//src/lib/fxl", |
| "//third_party/rapidjson", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/trace-with-static-engine", |
| "//zircon/system/ulib/trace-reader", |
| ] |
| } |
| |
| executable("trace_integration_tests") { |
| testonly = true |
| output_name = "trace_integration_tests" |
| |
| sources = [ "trace_integration_tests.cc" ] |
| |
| deps = [ |
| ":gtest_main", |
| ":integration_test_utils", |
| ":run_test", |
| "//src/developer/tracing/lib/test_utils", |
| "//src/lib/fxl/test:test_settings", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/async-loop-default", |
| ] |
| |
| # TODO(46850): Fix the leaks and remove this. |
| deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ] |
| } |
| |
| executable("run_integration_test") { |
| testonly = true |
| output_name = "run_integration_test" |
| |
| sources = [ "run_integration_test.cc" ] |
| |
| deps = [ |
| ":component_context", |
| ":integration_test_utils", |
| ":run_test", |
| "//sdk/lib/sys/cpp", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/async-loop-default", |
| ] |
| } |
| |
| executable("basic_integration_test_app") { |
| testonly = true |
| output_name = "basic_integration_test_app" |
| |
| sources = [ |
| "basic_integration_tests.cc", |
| "basic_integration_tests.h", |
| "fill_buffer_integration_test.cc", |
| "integration_test_main.cc", |
| "simple_integration_test.cc", |
| ] |
| |
| deps = [ |
| ":integration_test_utils", |
| "//garnet/lib/measure", |
| "//src/lib/fxl", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/async-loop-default", |
| "//zircon/public/lib/trace", |
| "//zircon/public/lib/trace-provider", |
| "//zircon/public/lib/zx", |
| ] |
| |
| # TODO(46850): Fix the leaks and remove this. |
| deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ] |
| } |
| |
| executable("two_providers_one_engine") { |
| testonly = true |
| output_name = "two_providers_one_engine" |
| |
| sources = [ "two_providers_one_engine.cc" ] |
| |
| deps = [ |
| "//src/lib/fxl", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/async-loop-default", |
| "//zircon/public/lib/trace", |
| "//zircon/public/lib/trace-provider", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| shared_library("self_contained_provider") { |
| testonly = true |
| |
| sources = [ |
| "self_contained_provider.cc", |
| "self_contained_provider.h", |
| ] |
| |
| deps = [ |
| ":integration_test_utils_with_trace_with_static_engine", |
| "//src/lib/fxl", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/async-loop-default", |
| "//zircon/public/lib/trace-provider-fdio-connect", |
| "//zircon/public/lib/trace-provider-with-static-engine", |
| "//zircon/public/lib/trace-with-static-engine", |
| ] |
| } |
| |
| executable("two_providers_two_engines_test_app") { |
| testonly = true |
| output_name = "two_providers_two_engines_test_app" |
| |
| sources = [ |
| "integration_test_main.cc", |
| "self_contained_provider.h", |
| "two_providers_two_engines.cc", |
| ] |
| |
| deps = [ |
| ":integration_test_utils", |
| ":self_contained_provider", |
| "//garnet/bin/trace:spec", |
| "//src/lib/fxl", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/async-loop-default", |
| "//zircon/public/lib/trace", |
| "//zircon/public/lib/trace-provider", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| executable("nested_environment_test") { |
| testonly = true |
| output_name = "nested_environment_test" |
| |
| sources = [ "nested_environment_test.cc" ] |
| |
| deps = [ |
| "//src/lib/fxl", |
| "//zircon/public/lib/task-utils", |
| "//zircon/public/lib/zx", |
| ] |
| |
| # TODO(46850): Fix the leaks and remove this. |
| deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ] |
| } |
| |
| executable("return_1234") { |
| testonly = true |
| output_name = "return_1234" |
| |
| sources = [ "return_1234.cc" ] |
| } |
| |
| executable("return_child_result_tests") { |
| testonly = true |
| output_name = "return_child_result_tests" |
| |
| sources = [ "return_child_result_tests.cc" ] |
| |
| deps = [ |
| ":gtest_main", |
| ":integration_test_utils", |
| ":run_test", |
| "//src/developer/tracing/lib/test_utils", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| executable("run_awhile") { |
| testonly = true |
| output_name = "run_awhile" |
| |
| sources = [ "run_awhile.cc" ] |
| |
| deps = [ "//zircon/public/lib/zx" ] |
| } |
| |
| executable("detach_tests") { |
| testonly = true |
| output_name = "detach_tests" |
| |
| sources = [ "detach_tests.cc" ] |
| |
| deps = [ |
| ":gtest_main", |
| ":integration_test_utils", |
| ":run_test", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| executable("ktrace_integration_tests") { |
| testonly = true |
| output_name = "ktrace_integration_tests" |
| |
| sources = [ "ktrace_integration_tests.cc" ] |
| |
| deps = [ |
| ":gtest_main", |
| ":integration_test_utils", |
| ":run_test", |
| "//src/developer/tracing/lib/test_utils", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/trace-reader", |
| ] |
| } |
| |
| executable("shared_provider_app") { |
| testonly = true |
| |
| sources = [ "shared_provider.cc" ] |
| |
| deps = [ |
| ":integration_test_utils", |
| "//src/lib/fxl", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/async-loop-default", |
| "//zircon/public/lib/trace", |
| "//zircon/public/lib/trace-provider-so", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| executable("shared_provider_integration_tests") { |
| testonly = true |
| |
| sources = [ "shared_provider_integration_tests.cc" ] |
| |
| deps = [ |
| ":gtest_main", |
| ":integration_test_utils", |
| ":run_test", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/trace-reader", |
| ] |
| } |
| |
| executable("provider_destruction_app") { |
| testonly = true |
| |
| sources = [ "provider_destruction.cc" ] |
| |
| deps = [ |
| ":integration_test_utils", |
| "//src/lib/fxl", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/async-loop-default", |
| "//zircon/public/lib/trace", |
| "//zircon/public/lib/trace-provider", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| executable("provider_destruction_tests") { |
| testonly = true |
| |
| sources = [ "provider_destruction_tests.cc" ] |
| |
| deps = [ |
| ":gtest_main", |
| ":integration_test_utils", |
| ":run_test", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/trace-reader", |
| ] |
| } |
| |
| test_package("trace_tests") { |
| rootjob_svc = "//build" |
| |
| deps = [ |
| ":basic_integration_test_app", |
| ":detach_tests", |
| ":ktrace_integration_tests", |
| ":nested_environment_test", |
| ":provider_destruction_app", |
| ":provider_destruction_tests", |
| ":return_1234", |
| ":return_child_result_tests", |
| ":run_awhile", |
| ":run_integration_test", |
| ":shared_provider_app", |
| ":shared_provider_integration_tests", |
| ":trace_integration_tests", |
| ":trace_tests_bin", |
| ":two_providers_one_engine", |
| ":two_providers_two_engines_test_app", |
| ] |
| |
| tests = [ |
| { |
| name = "detach_tests" |
| environments = basic_envs |
| }, |
| { |
| name = "ktrace_integration_tests" |
| environments = basic_envs |
| }, |
| { |
| name = "provider_destruction_tests" |
| environments = basic_envs |
| }, |
| { |
| name = "return_child_result_tests" |
| environments = basic_envs |
| }, |
| { |
| name = "shared_provider_integration_tests" |
| environments = basic_envs |
| }, |
| { |
| name = "trace_integration_tests" |
| environments = basic_envs |
| }, |
| { |
| name = "trace_tests" |
| environments = basic_envs |
| }, |
| ] |
| |
| binaries = [ |
| { |
| name = "basic_integration_test_app" |
| }, |
| { |
| name = "nested_environment_test" |
| }, |
| { |
| name = "provider_destruction_app" |
| }, |
| { |
| name = "return_1234" |
| }, |
| { |
| name = "run_awhile" |
| }, |
| { |
| name = "run_integration_test" |
| }, |
| { |
| name = "shared_provider_app" |
| }, |
| { |
| name = "two_providers_one_engine" |
| }, |
| { |
| name = "two_providers_two_engines_test_app" |
| }, |
| ] |
| |
| # Since this is a "test_package" there is no need to list the cmx files |
| # for the "tests" entries. |
| meta = [ |
| { |
| path = rebase_path("meta/basic_integration_test_app.cmx") |
| dest = "basic_integration_test_app.cmx" |
| }, |
| { |
| path = rebase_path("meta/run_integration_test.cmx") |
| dest = "run_integration_test.cmx" |
| }, |
| { |
| path = rebase_path("meta/nested_environment_test.cmx") |
| dest = "nested_environment_test.cmx" |
| }, |
| { |
| path = rebase_path("meta/provider_destruction_app.cmx") |
| dest = "provider_destruction_app.cmx" |
| }, |
| { |
| path = rebase_path("meta/shared_provider_app.cmx") |
| dest = "shared_provider_app.cmx" |
| }, |
| { |
| path = rebase_path("meta/two_providers_two_engines_test_app.cmx") |
| dest = "two_providers_two_engines_test_app.cmx" |
| }, |
| ] |
| |
| resources = [ |
| { |
| path = rebase_path("oneshot.tspec") |
| dest = "oneshot.tspec" |
| }, |
| { |
| path = rebase_path("circular.tspec") |
| dest = "circular.tspec" |
| }, |
| { |
| path = rebase_path("streaming.tspec") |
| dest = "streaming.tspec" |
| }, |
| { |
| path = rebase_path("simple.tspec") |
| dest = "simple.tspec" |
| }, |
| { |
| path = rebase_path("nested_environment_test.tspec") |
| dest = "nested_environment_test.tspec" |
| }, |
| { |
| path = rebase_path("two_providers_two_engines.tspec") |
| dest = "two_providers_two_engines.tspec" |
| }, |
| ] |
| } |