summaryrefslogtreecommitdiffhomepage
path: root/test/runtimes/defs.bzl
blob: 3eb494958c685ea57e3b90a1526536769fece1e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""Defines a rule for runtime test targets."""

load("//tools:defs.bzl", "go_test")

def runtime_test(name, lang, exclude_file, **kwargs):
    go_test(
        name = name,
        srcs = ["runner.go"],
        args = [
            "--lang",
            lang,
            "--image",
            name,  # Resolved as images/runtimes/%s.
            "--exclude_file",
            "test/runtimes/" + exclude_file,
        ],
        data = [
            exclude_file,
            "//test/runtimes/proctor",
        ],
        defines_main = 1,
        tags = [
            "local",
            "manual",
        ],
        deps = [
            "//pkg/log",
            "//pkg/test/dockerutil",
            "//pkg/test/testutil",
        ],
        **kwargs
    )

def exclude_test(name, exclude_file):
    """Test that a exclude file parses correctly."""
    go_test(
        name = name + "_exclude_test",
        library = ":runner",
        srcs = ["exclude_test.go"],
        args = ["--exclude_file", "test/runtimes/" + exclude_file],
        data = [exclude_file],
    )