| 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 |
|
| 7 |
if 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.toml. |
| 14 |
CppUnitTests( |
| 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 |
"TestSIMD", |
| 61 |
"TestSmallPointerArray", |
| 62 |
"TestSplayTree", |
| 63 |
"TestTextUtils", |
| 64 |
"TestTypedEnum", |
| 65 |
"TestUniquePtr", |
| 66 |
"TestVariant", |
| 67 |
"TestVector", |
| 68 |
"TestWeakPtr", |
| 69 |
"TestWrappingOperations", |
| 70 |
"TestXorShift128PlusRNG", |
| 71 |
] |
| 72 |
) |
| 73 |
|
| 74 |
# We don't support these tests yet because of the lack of thread support for wasi. |
| 75 |
if CONFIG["OS_ARCH"] != "WASI": |
| 76 |
CppUnitTests( |
| 77 |
[ |
| 78 |
"TestMPSCQueue", |
| 79 |
"TestSPSCQueue", |
| 80 |
"TestThreadSafeWeakPtr", |
| 81 |
] |
| 82 |
) |
| 83 |
|
| 84 |
if CONFIG["OS_ARCH"] == "WINNT": |
| 85 |
CppUnitTests( |
| 86 |
[ |
| 87 |
"TestWinArchDefs", |
| 88 |
] |
| 89 |
) |
| 90 |
|
| 91 |
if CONFIG["OS_ARCH"] == "Linux": |
| 92 |
CppUnitTests( |
| 93 |
[ |
| 94 |
"TestMozCrash", |
| 95 |
] |
| 96 |
) |
| 97 |
|
| 98 |
# Not to be unified with the rest, because this test |
| 99 |
# sets MOZ_PRETEND_NO_JSRUST, which changes the behavior |
| 100 |
# of the included headers. |
| 101 |
CppUnitTests( |
| 102 |
[ |
| 103 |
"TestUtf8", |
| 104 |
] |
| 105 |
) |
| 106 |
|
| 107 |
# Wasi doesn't support <signal> yet so skip this test. |
| 108 |
if not CONFIG["MOZ_ASAN"] and not CONFIG["MOZ_TSAN"] and CONFIG["OS_ARCH"] != "WASI": |
| 109 |
CppUnitTests( |
| 110 |
[ |
| 111 |
"TestPoisonArea", |
| 112 |
] |
| 113 |
) |
| 114 |
|
| 115 |
DisableStlWrapping() |
| 116 |
|
| 117 |
if CONFIG["CC_TYPE"] == "clang-cl": |
| 118 |
CXXFLAGS += [ |
| 119 |
"-wd4275", # non dll-interface class used as base for dll-interface class |
| 120 |
"-wd4530", # C++ exception handler used, but unwind semantics are not enabled |
| 121 |
] |
| 122 |
|
| 123 |
USE_LIBS += [ |
| 124 |
"mozglue", |
| 125 |
] |
| 126 |
|
| 127 |
if CONFIG["MOZ_ASAN"] or CONFIG["MOZ_UBSAN"] or CONFIG["MOZ_TSAN"]: |
| 128 |
USE_LIBS += ["sanitizer-options"] |