| # 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/package.gni") |
| import("//build/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":cpuperf_integration_tests", |
| ":cpuperf_tests", |
| ":cpuperf_tests_bin", |
| ] |
| } |
| |
| 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") { |
| 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", |
| "//src/lib/fxl", |
| "//src/lib/fxl/test:test_settings", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| test_package("cpuperf_tests") { |
| deps = [ |
| ":cpuperf_integration_tests", |
| ":cpuperf_tests_bin", |
| ] |
| |
| tests = [ |
| { |
| name = "cpuperf_integration_tests" |
| environments = basic_envs |
| }, |
| { |
| name = "cpuperf_tests" |
| environments = basic_envs |
| }, |
| ] |
| |
| resources = [] |
| |
| if (current_cpu == "arm64") { |
| resources += [ |
| { |
| path = rebase_path("arm64/tally.cpspec") |
| dest = "tally.cpspec" |
| }, |
| ] |
| } |
| |
| if (current_cpu == "x64") { |
| resources += [ |
| { |
| path = rebase_path("gen_printer_test_data.cpspec") |
| dest = "gen_printer_test_data.cpspec" |
| }, |
| { |
| path = rebase_path("intel/fixed_counters.cpspec") |
| dest = "fixed_counters.cpspec" |
| }, |
| { |
| path = rebase_path("intel/last_branch.cpspec") |
| dest = "last_branch.cpspec" |
| }, |
| { |
| path = rebase_path("intel/os_flag.cpspec") |
| dest = "os_flag.cpspec" |
| }, |
| { |
| path = rebase_path("intel/programmable_counters.cpspec") |
| dest = "programmable_counters.cpspec" |
| }, |
| { |
| path = rebase_path("intel/tally.cpspec") |
| dest = "tally.cpspec" |
| }, |
| { |
| path = rebase_path("intel/user_flag.cpspec") |
| dest = "user_flag.cpspec" |
| }, |
| { |
| path = rebase_path("intel/value_records.cpspec") |
| dest = "value_records.cpspec" |
| }, |
| ] |
| } |
| } |