blob: 8fa9af14ae36de3896f50cdd80ba904dfec44012 [file] [log] [blame]
# Copyright 2018 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/testing/environments.gni")
import("//src/sys/build/components.gni")
group("tests") {
testonly = true
deps = [
":cpuperf_integration_tests",
":cpuperf_tests",
]
}
executable("cpuperf_tests_bin") {
testonly = true
output_name = "cpuperf_tests"
deps = [
"//garnet/bin/cpuperf:unittests",
"//src/lib/fxl/test:gtest_main",
]
}
executable("cpuperf_integration_tests_bin") {
testonly = true
output_name = "cpuperf_integration_tests"
sources = [
"integration_tests.cc",
"run_test.cc",
"run_test.h",
"verify_test.cc",
"verify_test.h",
]
if (current_cpu == "arm64") {
sources += [
"arm64/arm64_tests.cc",
"arm64/arm64_tests.h",
"arm64/tally.cc",
]
}
if (current_cpu == "x64") {
sources += [
"intel/fixed_counters.cc",
"intel/intel_tests.cc",
"intel/intel_tests.h",
"intel/last_branch.cc",
"intel/os_flag.cc",
"intel/programmable_counters.cc",
"intel/tally.cc",
"intel/user_flag.cc",
"intel/value_records.cc",
]
}
deps = [
"//garnet/bin/cpuperf:session_result_spec",
"//garnet/bin/cpuperf:session_spec",
"//garnet/lib/perfmon",
"//sdk/lib/fdio",
"//src/lib/fxl",
"//src/lib/fxl/test:test_settings",
"//third_party/googletest:gtest",
"//zircon/public/lib/zx",
]
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
fuchsia_unittest_package("cpuperf_tests") {
manifest = "meta/cpuperf_tests.cmx"
deps = [
":cpuperf_resources",
":cpuperf_tests_bin",
]
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
}
fuchsia_test_component("cpuperf_integration_tests_package") {
component_name = "cpuperf_integration_tests"
manifest = "meta/cpuperf_integration_tests.cmx"
deps = [
":cpuperf_integration_tests_bin",
":cpuperf_resources",
]
}
fuchsia_test_package("cpuperf_integration_tests") {
test_components = [ ":cpuperf_integration_tests_package" ]
test_specs = {
# TODO(fxbug.dev/47484): Test fails on NUC w/ ASan. Fix and switch back to basic_envs.
environments = [ emu_env ] + nuc_env_fails_on_asan
}
}
resource("cpuperf_resources") {
if (current_cpu == "arm64") {
sources = [ "arm64/tally.cpspec" ]
}
if (current_cpu == "x64") {
sources = [
"gen_printer_test_data.cpspec",
"intel/fixed_counters.cpspec",
"intel/last_branch.cpspec",
"intel/os_flag.cpspec",
"intel/programmable_counters.cpspec",
"intel/tally.cpspec",
"intel/user_flag.cpspec",
"intel/value_records.cpspec",
]
}
outputs = [ "data/{{source_file_part}}" ]
}