summaryrefslogtreecommitdiff
path: root/src/mongo/stdx/SConscript
blob: bd253c826c76928291f0e154db9ce1b264b2343e (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
# -*- mode: python -*-

Import("env")

env = env.Clone()

env.Benchmark(
    target='condition_variable_bm',
    source=[
        'condition_variable_bm.cpp',
    ],
    LIBDEPS=[
    ],
)

env.Library(
    target='stdx',
    source=[
        'set_terminate_internals.cpp',
    ],
    LIBDEPS=[
        # Ideally, there should be no linking dependencies upon any other libraries, for `libstdx`.
        # This library is a shim filling in for deficiencies in various standard library
        # implementations.  There should never be any link-time dependencies into mongo internals.
    ],
)

env.CppUnitTest(
    target='stdx_test',
    source=[
        'unordered_map_test.cpp'
    ],
    LIBDEPS=[
        '$BUILD_DIR/third_party/shim_abseil',
    ],
)

# The tests for `stdx::set_terminate` need to run outside of the mongo unittest harneses.
# The tests require altering the global `set_terminate` handler, which our unittest framework
# doesn't expect to have happen.  Further, the tests have to return successfully from a
# terminate condition which interacts poorly with the unittest framework.
#
# A set of dedicated binaries to each test case is actually the simplest way to accomplish
# robust testing of this mechanism.

# Needs to be a different test -- It has to have direct control over the `main()` entry point.
env.RegisterUnitTest(env.Program(
    target='set_terminate_dispatch_test',
    source=[
        'set_terminate_dispatch_test.cpp',
    ],
    LIBDEPS=[
        'stdx',
    ]
)[0])

# Needs to be a different test -- It has to have direct control over the `main()` entry point.
env.RegisterUnitTest(env.Program(
    target='set_terminate_from_main_die_in_thread_test',
    source=[
        'set_terminate_from_main_die_in_thread_test.cpp',
    ],
    LIBDEPS=[
        'stdx',
    ]
)[0])

# Needs to be a different test -- It has to have direct control over the `main()` entry point.
env.RegisterUnitTest(env.Program(
    target='set_terminate_from_thread_die_in_main_test',
    source=[
        'set_terminate_from_thread_die_in_main_test.cpp',
    ],
    LIBDEPS=[
        'stdx',
    ]
)[0])

# Needs to be a different test -- It has to have direct control over the `main()` entry point.
env.RegisterUnitTest(env.Program(
    target='set_terminate_from_thread_die_in_thread_test',
    source=[
        'set_terminate_from_thread_die_in_thread_test.cpp',
    ],
    LIBDEPS=[
        'stdx',
    ]
)[0])