summaryrefslogtreecommitdiffstats
path: root/base/base_unittests.scons
blob: 7b1cc28efd5717281d04d181fa58a3e52c026e6a (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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

__doc__ = """
Configuration for building base_unittests{,.exe}.
"""

Import('env')

env = env.Clone()

env.SConscript([
    '$BASE_DIR/using_base.scons',
    '$BASE_DIR/gfx/using_base_gfx.scons',
    '$GTEST_DIR/../using_gtest.scons',
    '$ICU38_DIR/using_icu38.scons',
    '$LIBPNG_DIR/using_libpng.scons',
    '$SKIA_DIR/using_skia.scons',
    '$ZLIB_DIR/using_zlib.scons',
], {'env':env})

if env['PLATFORM'] in ('posix', 'darwin'):
  env.SConscript([
      '$LIBEVENT_DIR/using_libevent.scons',
  ], {'env':env})

env.Prepend(
    CPPPATH = [
        '$CHROME_SRC_DIR',
    ],
    CPPDEFINES = [
        'GOOGLE_CHROME_BUILD',
    ],
)

if env['PLATFORM'] == 'win32':
  env.Prepend(
      CCFLAGS = [
          '/TP',
          '/WX',
      ],
      CPPDEFINES = [
          '_WIN32_WINNT=0x0600',
          'WINVER=0x0600',
          '_HAS_EXCEPTIONS=0',
      ],
      LINKFLAGS = [
          '/MANIFEST',
          '/DELAYLOAD:"dwmapi.dll"',
          '/DELAYLOAD:"uxtheme.dll"',
          '/MACHINE:X86',
          '/FIXED:No',

          '/safeseh',
          '/dynamicbase',
          '/ignore:4199',
          '/nxcompat',
      ],
  )

if env['PLATFORM'] == 'posix':
  env.Append(
      # We need 'Xss' (X Screen Saver) in LIBS if we want idletimer_unittest
      LIBS = [
          'event',
      ],
  )

# These test files work on *all* platforms; tests that don't work
# cross-platform live below.
input_files = [
    'at_exit_unittest.cc',
    'atomicops_unittest.cc',
    'clipboard_unittest.cc',
    'command_line_unittest.cc',
    'condition_variable_unittest.cc',
    'field_trial_unittest.cc',
    'file_path_unittest.cc',
    'file_util_unittest.cc',
    'histogram_unittest.cc',
    'hmac_unittest.cc',
    'idletimer_unittest.cc',
    'json_reader_unittest.cc',
    'json_writer_unittest.cc',
    'lazy_instance_unittest.cc',
    'linked_ptr_unittest.cc',
    'message_loop_unittest.cc',
    'observer_list_unittest.cc',
    'path_service_unittest.cc',
    'pickle_unittest.cc',
    'pr_time_unittest.cc',
    'process_util_unittest.cc',
    'rand_util_unittest.cc',
    'ref_counted_unittest.cc',
    'run_all_unittests.cc',
    'scoped_ptr_unittest.cc',
    'sha2_unittest.cc',
    'shared_memory_unittest.cc',
    'simple_thread_unittest.cc',
    'singleton_unittest.cc',
    'stack_container_unittest.cc',
    'stats_table_unittest.cc',
    'string_escape_unittest.cc',
    'string_piece_unittest.cc',
    'string_tokenizer_unittest.cc',
    'string_util_unittest.cc',
    'sys_info_unittest.cc',
    'thread_local_storage_unittest.cc',
    'thread_local_unittest.cc',
    'thread_unittest.cc',
    'time_unittest.cc',
    'timer_unittest.cc',
    'tracked_objects_unittest.cc',
    'tuple_unittest.cc',
    'values_unittest.cc',
    'waitable_event_unittest.cc',
    'watchdog_unittest.cc',
    'word_iterator_unittest.cc',
    'worker_pool_unittest.cc',
     
    'gfx/convolver_unittest.cc',
    'gfx/image_operations_unittest.cc',
    'gfx/native_theme_unittest.cc',
    'gfx/png_codec_unittest.cc',
    'gfx/rect_unittest.cc',
    'gfx/uniscribe_unittest.cc',
    'gfx/vector_canvas_unittest.cc',
]

if env['PLATFORM'] in ('posix', 'darwin'):
  #env.ChromeTestProgram('debug_message', ['debug_message.cc'])

  # Remove files that still need to be ported from the input_files list.
  # TODO(port): delete files from this list as they get ported.
  to_be_ported_files = [
      # We have an implementation of idle_timer, but it's unclear if we want it
      # yet, so it's commented out for now.  Leave this 'unported'.
      'idletimer_unittest.cc',

      'watchdog_unittest.cc',
      'gfx/native_theme_unittest.cc',
      'gfx/uniscribe_unittest.cc',
      'gfx/vector_canvas_unittest.cc',
  ]
  for remove in to_be_ported_files:
    input_files.remove(remove)

if env['PLATFORM'] == 'darwin':
  # Remove files that still need to be ported from the input_files list.
  # TODO(port): delete files from this list as they get ported.
  to_be_ported_files = [
      'process_util_unittest.cc',
      'stats_table_unittest.cc',
  ]
  for remove in to_be_ported_files:
    input_files.remove(remove)


if env['PLATFORM'] == 'win32':
  # Windows-specific tests.
  input_files.extend([
      'directory_watcher_unittest.cc',
      'file_version_info_unittest.cc',
      'object_watcher_unittest.cc',
      'pe_image_unittest.cc',
      'sys_string_conversions_unittest.cc',
      'time_unittest_win.cc',
      'win_util_unittest.cc',
      'wmi_util_unittest.cc',
  ])

if env['PLATFORM'] == 'darwin':
  # Mac-specific tests.
  input_files.extend([
      'platform_test_mac.mm',
  ])

env.ChromeTestProgram('base_unittests', input_files)

# TODO(sgk) should this be moved into base.lib like everything else?  This will
# require updating a bunch of other SConscripts which link directly against
# this generated object file.
env.StaticObject('perftimer.cc')

# Since run_all_perftests supplies a main, we cannot have it in base.lib
env.StaticObject('run_all_perftests.cc')