| # 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/test/test_package.gni") |
| |
| source_set("common") { |
| visibility = [ |
| ":*", |
| "//src/lib/files:*", |
| "//src/lib/fsl/handles:*", |
| "//src/lib/fsl/io:*", |
| "//src/lib/fsl/socket:*", |
| "//src/lib/fsl/tasks:*", |
| ] |
| |
| sources = [ |
| "build_config.h", |
| "fxl_export.h", |
| "macros.h", |
| ] |
| } |
| |
| source_set("memory") { |
| visibility = [ |
| ":*", |
| "//src/lib/files:*", |
| "//src/lib/fsl/io:*", |
| "//src/lib/fsl/vmo:*", |
| ] |
| |
| sources = [ |
| "memory/ref_counted.h", |
| "memory/ref_counted_internal.h", |
| "memory/ref_ptr.h", |
| "memory/ref_ptr_internal.h", |
| "memory/unique_object.h", |
| "memory/weak_ptr.h", |
| "memory/weak_ptr_internal.cc", |
| "memory/weak_ptr_internal.h", |
| ] |
| |
| public_deps = [ |
| ":common", |
| "//sdk/lib/syslog/cpp", |
| ] |
| configs += [ |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| "//build/config:Wno-conversion", |
| ] |
| } |
| |
| source_set("strings") { |
| visibility = [ |
| ":*", |
| "//src/lib/files:*", |
| "//src/lib/uuid:*", |
| ] |
| |
| sources = [ |
| "strings/ascii.cc", |
| "strings/ascii.h", |
| "strings/concatenate.cc", |
| "strings/concatenate.h", |
| "strings/join_strings.h", |
| "strings/split_string.cc", |
| "strings/split_string.h", |
| "strings/string_number_conversions.cc", |
| "strings/string_number_conversions.h", |
| "strings/string_printf.cc", |
| "strings/string_printf.h", |
| "strings/substitute.cc", |
| "strings/substitute.h", |
| "strings/trim.cc", |
| "strings/trim.h", |
| "strings/utf_codecs.cc", |
| "strings/utf_codecs.h", |
| "third_party/icu/icu_utf.cc", |
| "third_party/icu/icu_utf.h", |
| ] |
| |
| public_deps = [ |
| ":common", |
| "//sdk/lib/syslog/cpp", |
| ] |
| configs += [ |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| "//build/config:Wno-conversion", |
| ] |
| } |
| |
| source_set("functional") { |
| visibility = [ ":*" ] |
| |
| sources = [ |
| "functional/apply.h", |
| "functional/cancelable_callback.h", |
| ] |
| |
| public_deps = [ |
| ":common", |
| ":memory", |
| "//sdk/lib/syslog/cpp", |
| ] |
| } |
| |
| static_library("fxl") { |
| sources = [ |
| "command_line.cc", |
| "command_line.h", |
| "log_settings_command_line.cc", |
| "log_settings_command_line.h", |
| "observer_list.h", |
| ] |
| |
| public_deps = [ |
| ":common", |
| ":functional", |
| ":memory", |
| ":strings", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/files", |
| "//zircon/public/lib/fit", |
| ] |
| configs += [ |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| "//build/config:Wno-conversion", |
| ] |
| } |
| |
| executable("fxl_unittests") { |
| testonly = true |
| |
| sources = [ |
| "//src/lib/fxl/log_settings_command_line_unittest.cc", |
| "command_line_unittest.cc", |
| "functional/apply_unittest.cc", |
| "functional/cancelable_callback_unittest.cc", |
| "memory/ref_counted_unittest.cc", |
| "memory/weak_ptr_unittest.cc", |
| "observer_list_unittest.cc", |
| "strings/ascii_unittest.cc", |
| "strings/concatenate_unittest.cc", |
| "strings/join_strings_unittest.cc", |
| "strings/split_string_unittest.cc", |
| "strings/string_number_conversions_unittest.cc", |
| "strings/string_printf_unittest.cc", |
| "strings/substitute_unittest.cc", |
| "strings/trim_unittest.cc", |
| "synchronization/thread_annotations_unittest.cc", |
| "test/test_settings_unittest.cc", |
| ] |
| |
| deps = [ |
| ":fxl", |
| "test:gtest_main", |
| "test:test_settings", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/files", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| if (is_fuchsia) { |
| import("//build/test/test_package.gni") |
| |
| test_package("fxl_tests") { |
| deps = [ ":fxl_unittests" ] |
| |
| tests = [ |
| { |
| name = "fxl_unittests" |
| }, |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":fxl_tests" ] |
| } |
| } |