blob: 8ad82d727bc0fd0da065f4bd756360873b6a70dd [file] [log] [blame]
# Copyright 2015 The Chromium 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("../mojo_edk.gni")
# Library of basic things not provided by the C/C++ standard libraries. (These
# are mostly platform independent. Note: This must not depend on
# //mojo/edk/platform. TODO(vtl): Maybe the things that aren't really platform
# independent should be moved to //mojo/edk/platform.)
mojo_edk_source_set("util") {
sources = [
"command_line.cc",
"command_line.h",
"cond_var.cc",
"cond_var.h",
"gtest_prod_utils.h",
"logging_internal.cc",
"logging_internal.h",
"make_unique.h",
"mutex.cc",
"mutex.h",
"ref_counted.h",
"ref_counted_internal.h",
"ref_ptr.h",
"ref_ptr_internal.h",
"scoped_file.h",
"string_number_conversions.cc",
"string_number_conversions.h",
"string_printf.cc",
"string_printf.h",
"thread_annotations.h",
"thread_checker.h",
"waitable_event.cc",
"waitable_event.h",
"weak_ptr.h",
"weak_ptr_internal.cc",
"weak_ptr_internal.h",
]
mojo_sdk_public_deps = [ "mojo/public/cpp/system" ]
}
# Unit tests for :util. For testing purposes, allow dependence on
# //mojo/edk/platform; however, using //mojo/edk/platform requires choosing an
# implementation to get a test binary, which is done below in
# :mojo_edk_util_unittests.
mojo_edk_source_set("unittests") {
testonly = true
sources = [
"command_line_unittest.cc",
"cond_var_unittest.cc",
"mutex_unittest.cc",
"ref_counted_unittest.cc",
"string_number_conversions_unittest.cc",
"string_printf_unittest.cc",
"thread_annotations_unittest.cc",
"thread_checker_unittest.cc",
"waitable_event_unittest.cc",
"weak_ptr_unittest.cc",
]
deps = [
":util",
"//testing/gtest",
]
mojo_sdk_deps = [ "mojo/public/cpp/system" ]
mojo_edk_deps = [
"mojo/edk/platform",
"mojo/edk/platform:test_platform",
"mojo/edk/system/test",
]
}
# Test binary for :util, using //mojo/edk/base_edk. TODO(vtl): Maybe this target
# should be in //mojo/edk/base_edk/BUILD.gn instead.
mojo_edk_unittests("mojo_edk_util_unittests") {
deps = [
":unittests",
]
mojo_edk_deps = [ "mojo/edk/base_edk" ]
}
mojo_edk_source_set("perftests") {
testonly = true
mojo_edk_visibility = [ "mojo/edk/system:mojo_edk_system_perftests" ]
sources = [
"ref_counted_perftest.cc",
]
deps = [
":util",
"//testing/gtest",
]
mojo_edk_deps = [
"mojo/edk/platform:test_platform",
"mojo/edk/system/test",
"mojo/edk/system/test:perf",
]
}