1# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2# vim: set filetype=python:
3# This Source Code Form is subject to the terms of the Mozilla Public
4# License, v. 2.0. If a copy of the MPL was not distributed with this
5# file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7if CONFIG["MOZ_WIDGET_TOOLKIT"]:
8    TEST_DIRS += [
9        "gtest",
10    ]
11
12# Important: for these tests to be run, they also need to be added
13# to testing/cppunittest.ini.
14CppUnitTests(
15    [
16        "TestAlgorithm",
17        "TestArray",
18        "TestArrayUtils",
19        "TestAtomicBitfields",
20        "TestAtomics",
21        "TestBinarySearch",
22        "TestBitSet",
23        "TestBloomFilter",
24        "TestBufferList",
25        "TestCasting",
26        "TestCeilingFloor",
27        "TestCheckedInt",
28        "TestCompactPair",
29        "TestCountPopulation",
30        "TestCountZeroes",
31        "TestDefineEnum",
32        "TestDoublyLinkedList",
33        "TestEndian",
34        "TestEnumeratedArray",
35        "TestEnumSet",
36        "TestEnumTypeTraits",
37        "TestFastBernoulliTrial",
38        "TestFloatingPoint",
39        "TestFunctionRef",
40        "TestFunctionTypeTraits",
41        "TestHashTable",
42        "TestIntegerRange",
43        "TestJSONWriter",
44        "TestLinkedList",
45        "TestMacroArgs",
46        "TestMacroForEach",
47        "TestMathAlgorithms",
48        "TestMaybe",
49        "TestNonDereferenceable",
50        "TestNotNull",
51        "TestRandomNum",
52        "TestRange",
53        "TestRefPtr",
54        "TestResult",
55        "TestRollingMean",
56        "TestSaturate",
57        "TestScopeExit",
58        "TestSegmentedVector",
59        "TestSHA1",
60        "TestSmallPointerArray",
61        "TestSplayTree",
62        "TestTemplateLib",
63        "TestTextUtils",
64        "TestTuple",
65        "TestTypedEnum",
66        "TestTypeTraits",
67        "TestUniquePtr",
68        "TestVariant",
69        "TestVector",
70        "TestWeakPtr",
71        "TestWrappingOperations",
72        "TestXorShift128PlusRNG",
73    ]
74)
75
76# We don't support these tests yet because of the lack of thread support for wasi.
77if CONFIG["OS_ARCH"] != "WASI":
78    CppUnitTests(
79        [
80            "TestSPSCQueue",
81            "TestThreadSafeWeakPtr",
82        ]
83    )
84
85# Not to be unified with the rest, because this test
86# sets MOZ_PRETEND_NO_JSRUST, which changes the behavior
87# of the included headers.
88CppUnitTests(
89    [
90        "TestUtf8",
91    ]
92)
93
94# Wasi doesn't support <signal> yet so skip this test.
95if not CONFIG["MOZ_ASAN"] and CONFIG["OS_ARCH"] != "WASI":
96    CppUnitTests(
97        [
98            "TestPoisonArea",
99        ]
100    )
101
102DisableStlWrapping()
103
104if CONFIG["CC_TYPE"] == "clang-cl":
105    CXXFLAGS += [
106        "-wd4275",  # non dll-interface class used as base for dll-interface class
107        "-wd4530",  # C++ exception handler used, but unwind semantics are not enabled
108    ]
109
110USE_LIBS += [
111    "mozglue",
112]
113