summaryrefslogtreecommitdiff
path: root/jstests/SConscript
blob: 6c74052db81937a08809a21b7f007ea45c2bbd64 (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
# Includes the jstests in distribution tarballs generated by SCons

import os
from collections import defaultdict

Import("env")
Import("get_option")

env = env.Clone()

if not get_option("install-mode") == "hygienic":
    Return()

jstests = env.Glob("**/*.js")

# Group by directory to avoid making a million calls to AutoInstall
jstests_by_dir = defaultdict(list)
for jstest in jstests:
    jstests_by_dir[jstest.dir].append(jstest)

for directory, files in jstests_by_dir.items():
    env.AutoInstall(
        target="$PREFIX_SHAREDIR/jstests/" + str(directory),
        source=files,
        AIB_COMPONENT="jstests",
        AIB_ROLE="runtime",
        AIB_COMPONENTS_EXTRA=[
            "tests",
        ],
    )