| # Copyright 2022 The IREE Authors |
| # Licensed under the Apache License v2.0 with LLVM Exceptions. |
| # See https://llvm.org/LICENSE.txt for license information. |
| # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| """Creates a binary and a test for a cc benchmark target. |
| It's good to test that benchmarks run, but it's really annoying to run a billion |
| iterations of them every time you try to run tests. So we create these as |
| binaries and then invoke them as tests with `--benchmark_min_time=0`. |
| load(":native_binary.bzl", "native_test") |
| """Creates a binary and a test for a cc benchmark target. |
| Arguments passed to the binary target: |
| name, srcs, data, deps, copts, defines, linkopts, tags, testonly, **kwargs |
| Arguments passed to the test target: |
| {name}_test, tags, size, timeout, **kwargs |
| name = "{}_test".format(name), |
| args = ["--benchmark_min_time=0"], |