blob: 25ffa59824b0fa41d00b2258fefe3ab55b24a42e [file]
# Copyright 2025 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/components.gni")
import("//build/test.gni")
source_set("lib") {
sources = [ "lib.cc" ]
public = [ "lib.h" ]
deps = [
"//sdk/fidl/fuchsia.io:fuchsia.io_cpp",
"//sdk/fidl/fuchsia.pkg:fuchsia.pkg_cpp",
"//sdk/lib/async-loop:async-loop-default",
"//sdk/lib/component/incoming/cpp",
"//sdk/lib/fdio",
"//sdk/lib/fidl/cpp/wire",
"//sdk/lib/fit",
"//sdk/lib/sys/cpp",
"//sdk/lib/syslog/cpp",
"//src/storage/lib/vfs/cpp",
"//zircon/system/ulib/sync:sync-cpp",
"//zircon/system/ulib/zx",
]
public_deps = [ "//src/storage/fxfs/fidl/fuchsia.fxfs:fuchsia.fxfs_cpp" ]
}
executable("bin") {
output_name = "thrasher"
sources = [ "main.cc" ]
deps = [
":lib",
"//sdk/fidl/fuchsia.io:fuchsia.io_cpp", # Added
"//sdk/lib/async-default",
"//sdk/lib/async-loop:async-loop-cpp",
"//sdk/lib/async-loop:async-loop-default",
"//sdk/lib/component/incoming/cpp",
"//sdk/lib/fidl/cpp/wire",
"//src/lib/fxl",
"//src/lib/fxl:fxl_cli",
]
}
fuchsia_component("component") {
component_name = "thrasher"
manifest = "meta/thrasher.cml"
deps = [ ":bin" ]
}
fuchsia_package("thrasher") {
deps = [
":bin",
":component",
":thrasher_resources",
]
}
test("thrasher_test") {
sources = [ "tests.cc" ]
deps = [
":lib",
"//sdk/fidl/fuchsia.pkg:fuchsia.pkg_cpp",
"//sdk/lib/async-testing",
"//sdk/lib/component/incoming/cpp",
"//sdk/lib/fidl/cpp",
"//sdk/lib/fidl/cpp/wire",
"//sdk/lib/sys/component/cpp/testing:cpp",
"//sdk/lib/sys/cpp/testing:cpp",
"//sdk/lib/syslog/cpp",
"//src/lib/fxl/test:gtest_main",
"//src/lib/testing/loop_fixture",
"//src/storage/fxfs/fidl/fuchsia.fxfs:fuchsia.fxfs_cpp",
"//src/storage/lib/vfs/cpp",
"//third_party/googletest:gtest",
"//zircon/system/ulib/zx",
]
}
fuchsia_unittest_package("thrasher_tests") {
manifest = "meta/thrasher_tests.cml"
deps = [
":thrasher_empty_dir_resource",
":thrasher_test",
":thrasher_test_dir_resource",
":thrasher_test_resources",
":thrasher_unmappable_dir_resource",
]
}
resource("thrasher_test_resources") {
sources = [ "test_data" ]
outputs = [ "data/test_data" ]
}
resource("thrasher_empty_dir_resource") {
sources = [ "empty_dir/.placeholder" ]
outputs = [ "data/empty_dir/.placeholder" ]
}
resource("thrasher_unmappable_dir_resource") {
sources = [ "unmappable_dir/empty_file" ]
outputs = [ "data/unmappable_dir/empty_file" ]
}
resource("thrasher_test_dir_resource") {
sources = [ "test_dir/test_data" ]
outputs = [ "data/test_dir/test_data" ]
}
resource("thrasher_resources") {
sources = [ "test_data" ]
outputs = [ "data/test_data" ]
}
group("tests") {
testonly = true
deps = [ ":thrasher_tests" ]
}