diff --git a/zircon/system/ulib/cobalt-client/test/BUILD.gn b/zircon/system/ulib/cobalt-client/test/BUILD.gn index aa80d5a1822a161851dd0e7dbdfb7cebb284b5b6..636173938bdaa520545aa6c885b4c92eb96c1adf 100644 --- a/zircon/system/ulib/cobalt-client/test/BUILD.gn +++ b/zircon/system/ulib/cobalt-client/test/BUILD.gn @@ -11,11 +11,31 @@ group("test") { test("cobalt-client-unit") { sources = [ + "cobalt_logger_test.cpp", + "collector_test.cpp", + "counter_test.cpp", + "histogram_test.cpp", "in-memory-logger-test.cpp", + "main.cpp", + "metric_options_test.cpp", + "timer_test.cpp", + "types_internal_test.cpp", ] deps = [ + "$zx/system/fidl/fuchsia-cobalt:c", + "$zx/system/fidl/fuchsia-io:c", + "$zx/system/fidl/fuchsia-mem:c", + "$zx/system/ulib/async", + "$zx/system/ulib/async:async-cpp", + "$zx/system/ulib/async:async-default", + "$zx/system/ulib/async-loop", + "$zx/system/ulib/async-loop:async-loop-cpp", "$zx/system/ulib/cobalt-client", "$zx/system/ulib/cobalt-client:in-memory-logger", + "$zx/system/ulib/fidl", + "$zx/system/ulib/fidl-utils", + "$zx/system/ulib/sync", + "$zx/system/ulib/unittest", "$zx/system/ulib/zxtest", ] } diff --git a/zircon/system/utest/cobalt-client/cobalt_logger_test.cpp b/zircon/system/ulib/cobalt-client/test/cobalt_logger_test.cpp similarity index 100% rename from zircon/system/utest/cobalt-client/cobalt_logger_test.cpp rename to zircon/system/ulib/cobalt-client/test/cobalt_logger_test.cpp diff --git a/zircon/system/utest/cobalt-client/collector_test.cpp b/zircon/system/ulib/cobalt-client/test/collector_test.cpp similarity index 100% rename from zircon/system/utest/cobalt-client/collector_test.cpp rename to zircon/system/ulib/cobalt-client/test/collector_test.cpp diff --git a/zircon/system/utest/cobalt-client/counter_test.cpp b/zircon/system/ulib/cobalt-client/test/counter_test.cpp similarity index 100% rename from zircon/system/utest/cobalt-client/counter_test.cpp rename to zircon/system/ulib/cobalt-client/test/counter_test.cpp diff --git a/zircon/system/utest/cobalt-client/fake_logger.h b/zircon/system/ulib/cobalt-client/test/fake_logger.h similarity index 100% rename from zircon/system/utest/cobalt-client/fake_logger.h rename to zircon/system/ulib/cobalt-client/test/fake_logger.h diff --git a/zircon/system/utest/cobalt-client/histogram_test.cpp b/zircon/system/ulib/cobalt-client/test/histogram_test.cpp similarity index 100% rename from zircon/system/utest/cobalt-client/histogram_test.cpp rename to zircon/system/ulib/cobalt-client/test/histogram_test.cpp diff --git a/zircon/system/ulib/cobalt-client/test/main.cpp b/zircon/system/ulib/cobalt-client/test/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8daa95fafe64f42e40d2dff5b774fb27b4649149 --- /dev/null +++ b/zircon/system/ulib/cobalt-client/test/main.cpp @@ -0,0 +1,19 @@ +// 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. + +#include <unittest/unittest.h> +#include <zxtest/c/zxtest.h> + +int main(int argc, char** argv) { + const bool success = unittest_run_all_tests(argc, argv); + if (!success) { + return EXIT_FAILURE; + } + + const bool zxtest_success = RUN_ALL_TESTS(argc, argv) == 0; + if (!zxtest_success) { + return EXIT_FAILURE; + } + return EXIT_SUCCESS; +} diff --git a/zircon/system/utest/cobalt-client/metric_options_test.cpp b/zircon/system/ulib/cobalt-client/test/metric_options_test.cpp similarity index 100% rename from zircon/system/utest/cobalt-client/metric_options_test.cpp rename to zircon/system/ulib/cobalt-client/test/metric_options_test.cpp diff --git a/zircon/system/utest/cobalt-client/timer_test.cpp b/zircon/system/ulib/cobalt-client/test/timer_test.cpp similarity index 100% rename from zircon/system/utest/cobalt-client/timer_test.cpp rename to zircon/system/ulib/cobalt-client/test/timer_test.cpp diff --git a/zircon/system/utest/cobalt-client/types_internal_test.cpp b/zircon/system/ulib/cobalt-client/test/types_internal_test.cpp similarity index 100% rename from zircon/system/utest/cobalt-client/types_internal_test.cpp rename to zircon/system/ulib/cobalt-client/test/types_internal_test.cpp diff --git a/zircon/system/utest/BUILD.gn b/zircon/system/utest/BUILD.gn index ee393e5224d287a50af89af4c81d80292a2a7287..d64f70d26737fed43721e321da5f8fac1c9c8ec3 100644 --- a/zircon/system/utest/BUILD.gn +++ b/zircon/system/utest/BUILD.gn @@ -99,7 +99,6 @@ if (current_cpu != "") { "channel-fatal", "chromeos-disk-setup", "cleanup", - "cobalt-client", "compiler", "core", "cprng", diff --git a/zircon/system/utest/cobalt-client/BUILD.gn b/zircon/system/utest/cobalt-client/BUILD.gn deleted file mode 100644 index bb8e48ae74a1d8273fa3e5b67d22b37afabf61af..0000000000000000000000000000000000000000 --- a/zircon/system/utest/cobalt-client/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# 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. - -test("cobalt-client") { - sources = [ - "cobalt_logger_test.cpp", - "collector_test.cpp", - "counter_test.cpp", - "histogram_test.cpp", - "metric_options_test.cpp", - "timer_test.cpp", - "types_internal_test.cpp", - ] - deps = [ - "$zx/system/fidl/fuchsia-cobalt:c", - "$zx/system/fidl/fuchsia-io:c", - "$zx/system/fidl/fuchsia-mem:c", - "$zx/system/ulib/async", - "$zx/system/ulib/async:async-cpp", - "$zx/system/ulib/async:async-default", - "$zx/system/ulib/async-loop", - "$zx/system/ulib/async-loop:async-loop-cpp", - "$zx/system/ulib/cobalt-client", - "$zx/system/ulib/fbl", - "$zx/system/ulib/fdio", - "$zx/system/ulib/fidl", - "$zx/system/ulib/fidl-utils", - "$zx/system/ulib/sync", - "$zx/system/ulib/unittest", - "$zx/system/ulib/zircon", - "$zx/system/ulib/zx", - ] -}