blob: c6f54ea84e257ebb243b6c15d99fb69a14a5104c [file] [log] [blame]
# 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.
##########################################
# Though under //zircon, this build file #
# is meant to be used in the Fuchsia GN #
# build. #
# See fxb/36139. #
##########################################
assert(!defined(zx) || zx != "/",
"This file can only be used in the Fuchsia GN build.")
import("//build/test.gni")
import("//build/unification/zbi/bootfs_test.gni")
group("test") {
testonly = true
deps = [
":fit",
":fit-unittest",
]
}
test("fit-unittest") {
output_name = "fit-unittest-test"
if (is_fuchsia) {
configs += [ "//build/unification/config:zircon-migrated" ]
}
if (is_fuchsia) {
fdio_config = [ "//build/config/fuchsia:fdio_config" ]
if (configs + fdio_config - fdio_config != configs) {
configs -= fdio_config
}
}
sources = [
"string_view_test.cc",
"variant_tests.cc",
]
deps = [
"//zircon/public/lib/fit",
"//zircon/public/lib/zxtest",
]
configs += [ ":shadow" ]
if (is_fuchsia) {
deps += [ "//sdk/lib/fdio" ]
}
}
# TODO: Convert these to zxtest and move them into the test above.
test("fit") {
if (is_fuchsia) {
configs += [ "//build/unification/config:zircon-migrated" ]
}
if (is_fuchsia) {
fdio_config = [ "//build/config/fuchsia:fdio_config" ]
if (configs + fdio_config - fdio_config != configs) {
configs -= fdio_config
}
}
sources = [
"barrier_tests.cc",
"bridge_tests.cc",
"defer_tests.cc",
"examples/function_example1.cc",
"examples/function_example2.cc",
"examples/promise_example1.cc",
"examples/promise_example2.cc",
"examples/utils.cc",
"function_examples.cc",
"function_tests.cc",
"function_traits_tests.cc",
"future_tests.cc",
"nullable_tests.cc",
"optional_tests.cc",
"pending_task_tests.cc",
"promise_examples.cc",
"promise_tests.cc",
"result_examples.cc",
"result_tests.cc",
"scheduler_tests.cc",
"scope_tests.cc",
"sequencer_tests.cc",
"single_threaded_executor_tests.cc",
"source_location_tests.cc",
"suspended_task_tests.cc",
"traits_tests.cc",
"utility_internal_tests.cc",
]
deps = [
"//zircon/public/lib/fit",
"//zircon/public/lib/zxtest",
]
configs += [ ":shadow" ]
if (is_fuchsia) {
deps += [ "//sdk/lib/fdio" ]
}
# TODO(48668): Fix the leaks and remove this.
deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ]
}
config("shadow") {
# chromium uses this library, and enables the following flag,
# so these tests should work with this flag enabled
cflags_cc = [ "-Wshadow" ]
}
bootfs_test("fit-bootfs-test") {
name = "fit"
deps = [ ":fit" ]
}
bootfs_test("fit-unittest-bootfs-test") {
name = "fit-unittest-test"
deps = [ ":fit-unittest" ]
}