summaryrefslogtreecommitdiff
path: root/src/mongo/unittest/SConscript
blob: 3c5bb2b21eaad9540e0dcfb307567376d2fc42fd (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# -*- mode: python; -*-

Import("env")

env = env.Clone()
env.InjectThirdParty(libraries=['yaml'])
env.Library(
    target="golden_test_base",
    source=[
        'golden_test_base.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/third_party/shim_yaml',
    ],
)

utEnv = env.Clone()
utEnv.InjectThirdParty(libraries=['yaml'])
utEnv.Library(
    target="unittest",
    source=[
        'barrier.cpp',
        'bson_test_util.cpp',
        'death_test.cpp',
        'golden_test.cpp',
        'matcher.cpp',
        'matcher_core.cpp',
        'temp_dir.cpp',
        'unittest.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
        'golden_test_base',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/db/server_options_core',
        '$BUILD_DIR/mongo/util/options_parser/options_parser',
        '$BUILD_DIR/mongo/util/pcre_util',
        '$BUILD_DIR/mongo/util/pcre_wrapper',
        '$BUILD_DIR/third_party/shim_yaml',
    ],
    AIB_COMPONENT='unittests',
)

env.Library(
    target="unittest_main",
    source=[
        'unittest_main.cpp',
        'unittest_options.idl',
    ],
    LIBDEPS=[
        'unittest',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
        '$BUILD_DIR/mongo/db/wire_version',
        '$BUILD_DIR/mongo/util/options_parser/options_parser',
    ],
    AIB_COMPONENT='unittests',
)

env.Library(
    target="integration_test_main",
    source=[
        'integration_test_main.cpp',
        'integration_test_main.idl',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
        'unittest',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/client/connection_string',
        '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
        '$BUILD_DIR/mongo/db/server_options',
        '$BUILD_DIR/mongo/db/server_options_base',
        '$BUILD_DIR/mongo/db/serverinit',
        '$BUILD_DIR/mongo/db/service_context',
        '$BUILD_DIR/mongo/db/wire_version',
        '$BUILD_DIR/mongo/util/options_parser/options_parser',
        '$BUILD_DIR/mongo/util/options_parser/options_parser_init',
        '$BUILD_DIR/mongo/util/testing_options',
    ],
    AIB_COMPONENT='integration-tests',
)

bmEnv = env.Clone()
bmEnv.InjectThirdParty(libraries=['benchmark'])
bmEnv.Library(
    target='benchmark_main',
    source=[
        'benchmark_main.cpp',
    ],
    LIBDEPS=[
        # benchmark_main must not be made to depend on additional libraries.
        # Additional requirements should be handled by the benchmark itself.
        # Examples can be found in fail_point_bm and commands_bm. See SERVER-60691.
        '$BUILD_DIR/mongo/base',
        '$BUILD_DIR/third_party/shim_benchmark',
    ],
    AIB_COMPONENT='benchmarks',
)

env.Library(
    target='task_executor_proxy',
    source=[
        'task_executor_proxy.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/executor/task_executor_interface',
    ],
    AIB_COMPONENT='benchmarks',
)

env.CppUnitTest(
    target='unittest_test',
    source=[
        'golden_test_test.cpp',
        'unittest_test.cpp',
        'fixture_test.cpp',
        'temp_dir_test.cpp',
        'thread_assertion_monitor_test.cpp',
        'assert_that_test.cpp',
    ],
)

env.Benchmark(
    target='system_resource_canary_bm',
    source=[
        'system_resource_canary_bm.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/util/processinfo',
    ],
)