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
12CppUnitTests([
13    'TestArray',
14    'TestArrayUtils',
15    'TestAtomics',
16    'TestBinarySearch',
17    'TestBloomFilter',
18    'TestBufferList',
19    'TestCasting',
20    'TestCeilingFloor',
21    'TestCheckedInt',
22    'TestCountPopulation',
23    'TestCountZeroes',
24    'TestDefineEnum',
25    'TestDoublyLinkedList',
26    'TestEndian',
27    'TestEnumeratedArray',
28    'TestEnumSet',
29    'TestEnumTypeTraits',
30    'TestFastBernoulliTrial',
31    'TestFloatingPoint',
32    'TestIntegerPrintfMacros',
33    'TestIntegerRange',
34    'TestJSONWriter',
35    'TestLinkedList',
36    'TestMacroArgs',
37    'TestMacroForEach',
38    'TestMathAlgorithms',
39    'TestMaybe',
40    'TestNotNull',
41    'TestPair',
42    'TestRange',
43    'TestRefPtr',
44    'TestResult',
45    'TestRollingMean',
46    'TestSaturate',
47    'TestScopeExit',
48    'TestSegmentedVector',
49    'TestSHA1',
50    'TestSmallPointerArray',
51    'TestSplayTree',
52    'TestTemplateLib',
53    'TestTextUtils',
54    'TestThreadSafeWeakPtr',
55    'TestTuple',
56    'TestTypedEnum',
57    'TestTypeTraits',
58    'TestUniquePtr',
59    'TestVariant',
60    'TestVector',
61    'TestWeakPtr',
62    'TestWrappingOperations',
63    'TestXorShift128PlusRNG',
64])
65
66if not CONFIG['MOZ_ASAN']:
67    CppUnitTests([
68        'TestPoisonArea',
69    ])
70
71# Since we link directly with MFBT object files, define IMPL_MFBT
72DEFINES['IMPL_MFBT'] = True
73
74DisableStlWrapping()
75
76if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
77  CXXFLAGS += [
78    '-wd4275', # non dll-interface class used as base for dll-interface class
79    '-wd4530', # C++ exception handler used, but unwind semantics are not enabled
80  ]
81
82USE_LIBS += [
83    'mfbt',
84]
85
86if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
87    CXXFLAGS += ['-Wno-error=shadow']
88