• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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    ],
38)
39
40skia_cc_library(
41    name = "tests_base",
42    testonly = True,
43    srcs = [
44        "//tools:Registry.h",
45        "//tools:ResourceFactory.h",
46        "//tools:Resources.cpp",
47        "//tools:SkMetaData.cpp",
48        "//tools:SkMetaData.h",
49        "//tools:ToolUtils.cpp",
50        "//tools/fonts:test_font_manager_srcs",
51    ],
52    hdrs = [
53        "CtsEnforcement.h",
54        "Test.h",
55        "TestType.h",
56        "//tools:Resources.h",
57        "//tools:ToolUtils.h",
58        "//tools/flags:CommandLineFlags.h",
59        "//tools/fonts:test_empty_typeface",
60    ],
61    textual_hdrs = [
62        "//tools/fonts:test_fonts",
63    ],
64    deps = [
65        "//:core",
66        "//src/base",
67    ] + select({
68        "@platforms//os:android": ["//:fontmgr_android_freetype"],
69        "@platforms//os:linux": ["//:fontmgr_fontconfig_freetype"],
70        # TODO(kjlubick) mac, windows
71        "//conditions:default": ["//:fontmgr_empty"],
72    }),
73)
74
75unit_tests(
76    name = "core_tests",
77    resources = [
78        "//resources:core_test_resources",
79    ],
80    tests = CORE_TESTS,
81    deps = [
82        ":tests_base",
83        "//:core",
84    ],
85)
86
87unit_tests(
88    name = "record_tests",
89    extra_srcs = ["RecordTestUtils.h"],
90    tests = RECORD_TESTS,
91    deps = [
92        ":tests_base",
93        "//:core",
94    ],
95)
96
97# The set of all tests that can be compiled on Linux RBE
98test_suite(
99    name = "linux_rbe_tests",
100    tests = [
101        ":core_tests",
102        ":record_tests",
103    ],
104)
105
106android_unit_test(
107    name = "android_math_test",
108    srcs = ["MathTest.cpp"],
109    deps = [
110        ":tests_base",
111        "//:core",
112    ],
113)
114