1load("//bazel:skia_rules.bzl", "skia_cc_library") 2load("//tools/testrunners/unit:android_unit_test.bzl", "android_unit_test") 3load("//tools/testrunners/unit:unit_tests.bzl", "unit_tests") 4load( 5 ":testgroups.bzl", 6 "CORE_TESTS", 7 "RECORD_TESTS", 8) 9 10skia_cc_library( 11 name = "test_type", 12 hdrs = ["TestType.h"], 13 visibility = ["//tools/gpu:__pkg__"], 14) 15 16skia_cc_library( 17 name = "test_harness", 18 testonly = True, 19 srcs = [ 20 "CtsEnforcement.cpp", 21 "Test.cpp", 22 "TestHarness.cpp", 23 "//tools:Registry.h", 24 "//tools/flags:CommandLineFlags.cpp", 25 "//tools/flags:CommandLineFlags.h", 26 ], 27 hdrs = [ 28 "CtsEnforcement.h", 29 "Test.h", 30 "TestHarness.h", 31 "TestType.h", 32 ], 33 visibility = ["//tools/testrunners/unit:__pkg__"], 34 deps = [ 35 "//:core", 36 "//src/base", 37 "//tools/timer", 38 ], 39) 40 41skia_cc_library( 42 name = "tests_base", 43 testonly = True, 44 srcs = [ 45 "//tools:Registry.h", 46 "//tools:ResourceFactory.h", 47 "//tools:Resources.cpp", 48 "//tools:SkMetaData.cpp", 49 "//tools:SkMetaData.h", 50 "//tools:ToolUtils.cpp", 51 "//tools/fonts:test_font_manager_srcs", 52 ], 53 hdrs = [ 54 "CtsEnforcement.h", 55 "Test.h", 56 "TestType.h", 57 "//tools:Resources.h", 58 "//tools:ToolUtils.h", 59 "//tools/flags:CommandLineFlags.h", 60 "//tools/fonts:test_empty_typeface", 61 ], 62 features = ["layering_check"], 63 textual_hdrs = [ 64 "//tools/fonts:test_fonts", 65 ], 66 deps = [ 67 "//:core", 68 "//:pathops", 69 "//src/base", 70 "//src/core:core_priv", 71 ] + select({ 72 "@platforms//os:android": ["//:fontmgr_android_freetype"], 73 "@platforms//os:linux": [ 74 "//src/ports:fontations_support", 75 "//src/ports:freetype_support", 76 "@skia//:fontmgr_fontconfig_freetype", 77 ], 78 # TODO(kjlubick) mac, windows 79 "//conditions:default": ["//:fontmgr_empty"], 80 }), 81) 82 83unit_tests( 84 name = "core_tests", 85 resources = [ 86 "//resources:core_test_resources", 87 ], 88 tests = CORE_TESTS, 89 deps = [ 90 ":tests_base", 91 "//:core", 92 ], 93) 94 95unit_tests( 96 name = "record_tests", 97 extra_srcs = ["RecordTestUtils.h"], 98 tests = RECORD_TESTS, 99 deps = [ 100 ":tests_base", 101 "//:core", 102 ], 103) 104 105# The set of all tests that can be compiled on Linux RBE 106test_suite( 107 name = "linux_rbe_tests", 108 tests = [ 109 ":core_tests", 110 ":record_tests", 111 ], 112) 113 114android_unit_test( 115 name = "android_math_test", 116 srcs = ["MathTest.cpp"], 117 deps = [ 118 ":tests_base", 119 "//:core", 120 ], 121) 122