|  | # 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/fidl/fidl.gni") | 
|  | import("//build/test/test_package.gni") | 
|  |  | 
|  | group("tests") { | 
|  | testonly = true | 
|  | deps = [ | 
|  | ":modular_integration_tests", | 
|  | ":module_with_fake_runner", | 
|  | "modular_config", | 
|  |  | 
|  | # modular_test_harness is a dep for any test that uses test_harness_fixture | 
|  | # (all of the tests below). Add it here so that an fx set --with | 
|  | # //src/modular/tests includes it. | 
|  | "//src/cobalt/bin/testing/mock_cobalt", | 
|  | "//src/modular/bin/modular_test_harness", | 
|  | ] | 
|  | } | 
|  |  | 
|  | # FIDL services/structs used for testing code only. | 
|  | fidl("fuchsia.testing.modular") { | 
|  | sources = [ "test_service.test.fidl" ] | 
|  | } | 
|  |  | 
|  | executable("agent_services_test") { | 
|  | testonly = true | 
|  |  | 
|  | output_name = "agent_services_test" | 
|  |  | 
|  | sources = [ "agent_services_test.cc" ] | 
|  |  | 
|  | deps = [ | 
|  | ":fuchsia.testing.modular", | 
|  | "//sdk/fidl/fuchsia.modular.testing", | 
|  | "//sdk/lib/sys/cpp/testing:integration", | 
|  | "//src/lib/fxl/test:gtest_main", | 
|  | "//src/modular/lib/modular_test_harness/cpp:test_harness_fixture", | 
|  | "//src/modular/lib/pseudo_dir:pseudo_dir_server", | 
|  | "//third_party/googletest:gmock", | 
|  | ] | 
|  | } | 
|  |  | 
|  | executable("agent_session_restart_test") { | 
|  | testonly = true | 
|  |  | 
|  | output_name = "agent_session_restart_test" | 
|  |  | 
|  | sources = [ "agent_session_restart_test.cc" ] | 
|  |  | 
|  | deps = [ | 
|  | ":fuchsia.testing.modular", | 
|  | "//sdk/fidl/fuchsia.modular.testing", | 
|  | "//sdk/lib/sys/cpp/testing:integration", | 
|  | "//src/lib/fxl/test:gtest_main", | 
|  | "//src/modular/lib/modular_test_harness/cpp:test_harness_fixture", | 
|  | "//third_party/googletest:gmock", | 
|  | ] | 
|  | } | 
|  |  | 
|  | executable("sessionctl_test") { | 
|  | testonly = true | 
|  | output_name = "sessionctl_test" | 
|  | sources = [ "sessionctl_test.cc" ] | 
|  | deps = [ | 
|  | "//sdk/fidl/fuchsia.modular.testing", | 
|  | "//sdk/fidl/fuchsia.sys", | 
|  | "//sdk/lib/sys/cpp", | 
|  | "//sdk/lib/sys/cpp/testing:integration", | 
|  | "//src/lib/fxl/test:gtest_main", | 
|  | "//src/modular/bin/sessionctl:lib", | 
|  | "//src/modular/lib/modular_test_harness/cpp:test_harness_fixture", | 
|  | ] | 
|  | } | 
|  |  | 
|  | executable("session_shell_test") { | 
|  | testonly = true | 
|  |  | 
|  | sources = [ "session_shell_test.cc" ] | 
|  |  | 
|  | deps = [ | 
|  | ":fuchsia.testing.modular", | 
|  | "//sdk/fidl/fuchsia.modular.testing", | 
|  | "//sdk/lib/sys/cpp/testing:integration", | 
|  | "//src/lib/fxl/test:gtest_main", | 
|  | "//src/modular/bin/sessionmgr/testing:annotations_matchers", | 
|  | "//src/modular/lib/modular_config:modular_config_constants", | 
|  | "//src/modular/lib/modular_test_harness/cpp:test_harness_fixture", | 
|  | "//third_party/googletest:gmock", | 
|  | ] | 
|  | } | 
|  |  | 
|  | executable("basemgr_test") { | 
|  | testonly = true | 
|  |  | 
|  | sources = [ "basemgr_test.cc" ] | 
|  |  | 
|  | deps = [ | 
|  | ":fuchsia.testing.modular", | 
|  | "//sdk/lib/modular/testing/cpp", | 
|  | "//src/lib/fsl", | 
|  | "//src/lib/fxl/test:gtest_main", | 
|  | "//src/modular/lib/fidl:clone", | 
|  | "//src/modular/lib/modular_config", | 
|  | "//src/modular/lib/modular_test_harness/cpp:test_harness_fixture", | 
|  | "//src/modular/lib/pseudo_dir:pseudo_dir_server", | 
|  | ] | 
|  | } | 
|  |  | 
|  | executable("inspect_session_test") { | 
|  | testonly = true | 
|  |  | 
|  | sources = [ "inspect_session_test.cc" ] | 
|  |  | 
|  | deps = [ | 
|  | "//sdk/fidl/fuchsia.modular.testing", | 
|  | "//sdk/lib/inspect/contrib/cpp:archive_reader", | 
|  | "//sdk/lib/inspect/testing/cpp", | 
|  | "//sdk/lib/sys/cpp/testing:integration", | 
|  | "//sdk/lib/sys/inspect/cpp", | 
|  | "//src/lib/fsl", | 
|  | "//src/lib/fxl/test:gtest_main", | 
|  | "//src/modular/lib/modular_config", | 
|  | "//src/modular/lib/modular_test_harness/cpp:test_harness_fixture", | 
|  | "//src/modular/lib/modular_test_harness/cpp:test_harness_impl", | 
|  | "//third_party/googletest:gmock", | 
|  | ] | 
|  | } | 
|  |  | 
|  | executable("intents_test") { | 
|  | testonly = true | 
|  |  | 
|  | sources = [ "intents_test.cc" ] | 
|  |  | 
|  | deps = [ | 
|  | "//sdk/fidl/fuchsia.modular.testing", | 
|  | "//sdk/lib/sys/cpp/testing:integration", | 
|  | "//sdk/lib/syslog/cpp", | 
|  | "//src/lib/fsl", | 
|  | "//src/lib/fxl/test:gtest_main", | 
|  | "//src/modular/lib/modular_test_harness/cpp:test_harness_fixture", | 
|  | ] | 
|  | } | 
|  |  | 
|  | executable("intl_property_provider_test") { | 
|  | testonly = true | 
|  | sources = [ "intl_property_provider_test.cc" ] | 
|  | deps = [ | 
|  | "//sdk/fidl/fuchsia.intl", | 
|  | "//sdk/fidl/fuchsia.modular.testing", | 
|  | "//sdk/fidl/fuchsia.sys", | 
|  | "//sdk/fidl/fuchsia.ui.app", | 
|  | "//sdk/lib/sys/cpp", | 
|  | "//sdk/lib/sys/cpp/testing:integration", | 
|  | "//src/lib/fxl/test:gtest_main", | 
|  | "//src/modular/lib/app_driver/cpp:module_driver", | 
|  | "//src/modular/lib/modular_test_harness/cpp:test_harness_fixture", | 
|  | ] | 
|  | } | 
|  |  | 
|  | executable("module_context_test") { | 
|  | testonly = true | 
|  |  | 
|  | output_name = "module_context_test" | 
|  |  | 
|  | sources = [ "module_context_test.cc" ] | 
|  |  | 
|  | deps = [ | 
|  | "//sdk/fidl/fuchsia.modular.testing", | 
|  | "//sdk/lib/sys/cpp/testing:integration", | 
|  | "//sdk/lib/syslog/cpp", | 
|  | "//src/lib/fsl", | 
|  | "//src/lib/fxl/test:gtest_main", | 
|  | "//src/modular/lib/modular_test_harness/cpp:test_harness_fixture", | 
|  | "//third_party/googletest:gmock", | 
|  | ] | 
|  | } | 
|  |  | 
|  | executable("sessionmgr_integration_test") { | 
|  | testonly = true | 
|  |  | 
|  | sources = [ "sessionmgr_integration_test.cc" ] | 
|  |  | 
|  | deps = [ | 
|  | "//sdk/fidl/fuchsia.hardware.power.statecontrol", | 
|  | "//sdk/fidl/fuchsia.intl", | 
|  | "//sdk/fidl/fuchsia.modular.internal", | 
|  | "//sdk/fidl/fuchsia.modular.testing", | 
|  | "//sdk/fidl/fuchsia.session", | 
|  | "//sdk/fidl/fuchsia.sys", | 
|  | "//sdk/lib/fdio", | 
|  | "//sdk/lib/sys/cpp/testing:integration", | 
|  | "//src/lib/fsl", | 
|  | "//src/lib/fxl/test:gtest_main", | 
|  | "//src/modular/bin/sessionmgr/testing", | 
|  | "//src/modular/lib/modular_test_harness/cpp:test_harness_fixture", | 
|  | "//third_party/googletest:gmock", | 
|  | ] | 
|  | } | 
|  |  | 
|  | executable("story_shell_factory_test") { | 
|  | testonly = true | 
|  |  | 
|  | sources = [ "story_shell_factory_test.cc" ] | 
|  |  | 
|  | deps = [ | 
|  | "//sdk/fidl/fuchsia.modular.testing", | 
|  | "//sdk/lib/sys/cpp/testing:integration", | 
|  | "//sdk/lib/syslog/cpp", | 
|  | "//src/lib/fxl/test:gtest_main", | 
|  | "//src/modular/lib/modular_test_harness/cpp:test_harness_fixture", | 
|  | "//src/modular/lib/testing:session_shell_impl", | 
|  | "//zircon/system/ulib/async-loop:async-loop-cpp", | 
|  | "//zircon/system/ulib/async-loop:async-loop-default", | 
|  | ] | 
|  | } | 
|  |  | 
|  | executable("story_shell_test") { | 
|  | testonly = true | 
|  |  | 
|  | output_name = "story_shell_test" | 
|  |  | 
|  | sources = [ "story_shell_test.cc" ] | 
|  |  | 
|  | deps = [ | 
|  | "//sdk/fidl/fuchsia.modular.testing", | 
|  | "//sdk/fidl/fuchsia.ui.app", | 
|  | "//sdk/lib/sys/cpp/testing:integration", | 
|  | "//sdk/lib/ui/scenic/cpp", | 
|  | "//src/lib/fsl", | 
|  | "//src/lib/fxl/test:gtest_main", | 
|  | "//src/modular/lib/modular_test_harness/cpp:test_harness_fixture", | 
|  | "//third_party/googletest:gmock", | 
|  | ] | 
|  | } | 
|  |  | 
|  | executable("component_context_test") { | 
|  | testonly = true | 
|  |  | 
|  | sources = [ "component_context_test.cc" ] | 
|  |  | 
|  | deps = [ | 
|  | "//sdk/fidl/fuchsia.modular.testing", | 
|  | "//sdk/lib/sys/cpp/testing:integration", | 
|  | "//src/lib/fxl/test:gtest_main", | 
|  | "//src/modular/lib/modular_test_harness/cpp:test_harness_fixture", | 
|  | "//zircon/system/ulib/fs", | 
|  | ] | 
|  | } | 
|  |  | 
|  | executable("stories_share_session_runners_test") { | 
|  | testonly = true | 
|  |  | 
|  | sources = [ "stories_share_session_runners_test.cc" ] | 
|  |  | 
|  | deps = [ | 
|  | ":module_with_fake_runner", | 
|  | "//sdk/fidl/fuchsia.intl", | 
|  | "//sdk/fidl/fuchsia.modular.testing", | 
|  | "//sdk/lib/sys/cpp/testing:integration", | 
|  | "//sdk/lib/syslog/cpp", | 
|  | "//src/lib/fxl/test:gtest_main", | 
|  | "//src/modular/lib/modular_test_harness/cpp:test_harness_fixture", | 
|  | ] | 
|  |  | 
|  | # TODO(fxbug.dev/58160): delete the below and fix compiler warnings | 
|  | configs += [ "//build/config:Wno-reorder-init-list" ] | 
|  | } | 
|  |  | 
|  | executable("module_with_fake_runner_bin") { | 
|  | testonly = true | 
|  |  | 
|  | output_name = "module_with_fake_runner" | 
|  |  | 
|  | sources = [ "module_with_fake_runner.cc" ] | 
|  |  | 
|  | deps = [ | 
|  | "//sdk/fidl/fuchsia.modular", | 
|  | "//sdk/lib/sys/cpp", | 
|  | "//src/modular/lib/app_driver/cpp:module_driver", | 
|  | "//src/modular/lib/integration_testing/cpp", | 
|  | "//zircon/system/ulib/async-loop:async-loop-cpp", | 
|  | "//zircon/system/ulib/async-loop:async-loop-default", | 
|  | ] | 
|  | } | 
|  |  | 
|  | package("module_with_fake_runner") { | 
|  | testonly = true | 
|  |  | 
|  | deps = [ ":module_with_fake_runner_bin" ] | 
|  |  | 
|  | binaries = [ | 
|  | { | 
|  | name = "module_with_fake_runner" | 
|  | }, | 
|  | ] | 
|  |  | 
|  | meta = [ | 
|  | { | 
|  | path = "meta/module_with_fake_runner.cmx" | 
|  | dest = "module_with_fake_runner.cmx" | 
|  | }, | 
|  | ] | 
|  | } | 
|  |  | 
|  | test_package("modular_integration_tests") { | 
|  | tests = [ | 
|  | { | 
|  | name = "agent_session_restart_test" | 
|  | environments = basic_envs | 
|  | }, | 
|  | { | 
|  | name = "agent_services_test" | 
|  | environments = basic_envs | 
|  | }, | 
|  | { | 
|  | name = "sessionmgr_integration_test" | 
|  | environments = basic_envs | 
|  | }, | 
|  | { | 
|  | name = "session_shell_test" | 
|  | environments = basic_envs | 
|  | }, | 
|  | { | 
|  | name = "basemgr_test" | 
|  | environments = basic_envs | 
|  | }, | 
|  | { | 
|  | name = "intents_test" | 
|  | environments = basic_envs | 
|  | }, | 
|  | { | 
|  | name = "inspect_session_test" | 
|  | environments = basic_envs | 
|  | }, | 
|  | { | 
|  | name = "intl_property_provider_test" | 
|  | environments = basic_envs | 
|  | }, | 
|  | { | 
|  | name = "module_context_test" | 
|  | environments = basic_envs | 
|  | }, | 
|  | { | 
|  | name = "story_shell_factory_test" | 
|  | environments = basic_envs | 
|  | }, | 
|  | { | 
|  | name = "story_shell_test" | 
|  | environments = basic_envs | 
|  | }, | 
|  | { | 
|  | name = "sessionctl_test" | 
|  | environments = basic_envs | 
|  | }, | 
|  | { | 
|  | name = "component_context_test" | 
|  | environments = basic_envs | 
|  | }, | 
|  | { | 
|  | name = "stories_share_session_runners_test" | 
|  | environments = basic_envs | 
|  | }, | 
|  | ] | 
|  |  | 
|  | deps = [ | 
|  | ":agent_services_test", | 
|  | ":agent_session_restart_test", | 
|  | ":basemgr_test", | 
|  | ":component_context_test", | 
|  | ":inspect_session_test", | 
|  | ":intents_test", | 
|  | ":intl_property_provider_test", | 
|  | ":module_context_test", | 
|  | ":session_shell_test", | 
|  | ":sessionctl_test", | 
|  | ":sessionmgr_integration_test", | 
|  | ":stories_share_session_runners_test", | 
|  | ":story_shell_factory_test", | 
|  | ":story_shell_test", | 
|  | ] | 
|  | } |