blob: d8977cd620613f3d700e990bd27a69c39e0857f7 [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/components.gni")
group("tests") {
testonly = true
deps = [
":cpuperf_integration_tests",
":cpuperf_tests",
]
}
executable("cpuperf_tests_bin") {
testonly = true
output_name = "cpuperf_tests"
deps = [
"//src/lib/fxl/test:gtest_main",
"//src/performance/cpuperf:unittests",
]
}
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 = [
"//sdk/lib/fdio",
"//src/lib/fxl",
"//src/lib/fxl/test:test_settings",
"//src/performance/cpuperf:session_result_spec",
"//src/performance/cpuperf:session_spec",
"//src/performance/lib/perfmon",
"//third_party/googletest:gtest",
"//zircon/system/ulib/zx",
]
}
fuchsia_unittest_package("cpuperf_tests") {
deps = [
":cpuperf_resources",
":cpuperf_tests_bin",
]
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
}
fuchsia_unittest_package("cpuperf_integration_tests") {
manifest = "meta/cpuperf_integration_tests.cml"
deps = [
":cpuperf_integration_tests_bin",
":cpuperf_resources",
]
}
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}}" ]
}