| OLD | NEW |
| 1 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 __doc__ = """ | 5 __doc__ = """ |
| 6 Configuration for building base_unittests{,.exe}. | 6 Configuration for building base_unittests{,.exe}. |
| 7 """ | 7 """ |
| 8 | 8 |
| 9 Import('env') | 9 Import('env') |
| 10 | 10 |
| 11 env = env.Clone() | 11 env = env.Clone() |
| 12 | 12 |
| 13 env.ApplySConscript([ | 13 env.ApplySConscript([ |
| 14 '$BASE_DIR/using_base.scons', | 14 '$BASE_DIR/using_base.scons', |
| 15 '$BASE_DIR/gfx/using_base_gfx.scons', | 15 '$BASE_DIR/gfx/using_base_gfx.scons', |
| 16 '$GTEST_DIR/../using_gtest.scons', | 16 '$GTEST_DIR/../using_gtest.scons', |
| 17 '$ICU38_DIR/using_icu38.scons', | 17 '$ICU38_DIR/using_icu38.scons', |
| 18 '$LIBPNG_DIR/using_libpng.scons', | 18 '$LIBPNG_DIR/using_libpng.scons', |
| 19 '$SKIA_DIR/using_skia.scons', | 19 '$SKIA_DIR/using_skia.scons', |
| 20 '$ZLIB_DIR/using_zlib.scons', | 20 '$ZLIB_DIR/using_zlib.scons', |
| 21 ]) | 21 ]) |
| 22 | 22 |
| 23 if env['PLATFORM'] in ('posix', 'darwin'): | 23 if env.Bit('posix'): |
| 24 env.ApplySConscript([ | 24 env.ApplySConscript([ |
| 25 '$LIBEVENT_DIR/using_libevent.scons', | 25 '$LIBEVENT_DIR/using_libevent.scons', |
| 26 ]) | 26 ]) |
| 27 | 27 |
| 28 if env['PLATFORM'] == 'win32': | 28 if env.Bit('windows'): |
| 29 env.Prepend( | 29 env.Prepend( |
| 30 CCFLAGS = [ | 30 CCFLAGS = [ |
| 31 '/TP', | 31 '/TP', |
| 32 '/WX', | 32 '/WX', |
| 33 ], | 33 ], |
| 34 ) | 34 ) |
| 35 | 35 |
| 36 if env['PLATFORM'] == 'posix': | 36 if env.Bit('linux'): |
| 37 env.Append( | 37 env.Append( |
| 38 # We need 'Xss' (X Screen Saver) in LIBS if we want idletimer_unittest | 38 # We need 'Xss' (X Screen Saver) in LIBS if we want idletimer_unittest |
| 39 LIBS = [ | 39 LIBS = [ |
| 40 'event', | 40 'event', |
| 41 ], | 41 ], |
| 42 ) | 42 ) |
| 43 | 43 |
| 44 # These test files work on *all* platforms; tests that don't work | 44 # These test files work on *all* platforms; tests that don't work |
| 45 # cross-platform live below. | 45 # cross-platform live below. |
| 46 input_files = [ | 46 input_files = [ |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 'waitable_event_unittest.cc', | 92 'waitable_event_unittest.cc', |
| 93 'watchdog_unittest.cc', | 93 'watchdog_unittest.cc', |
| 94 'word_iterator_unittest.cc', | 94 'word_iterator_unittest.cc', |
| 95 'worker_pool_unittest.cc', | 95 'worker_pool_unittest.cc', |
| 96 | 96 |
| 97 'gfx/native_theme_unittest.cc', | 97 'gfx/native_theme_unittest.cc', |
| 98 'gfx/png_codec_unittest.cc', | 98 'gfx/png_codec_unittest.cc', |
| 99 'gfx/rect_unittest.cc', | 99 'gfx/rect_unittest.cc', |
| 100 ] | 100 ] |
| 101 | 101 |
| 102 if env['PLATFORM'] in ('posix', 'darwin'): | 102 if env.Bit('posix'): |
| 103 # Remove files that still need to be ported from the input_files list. | 103 # Remove files that still need to be ported from the input_files list. |
| 104 # TODO(port): delete files from this list as they get ported. | 104 # TODO(port): delete files from this list as they get ported. |
| 105 to_be_ported_files = [ | 105 to_be_ported_files = [ |
| 106 # We have an implementation of idle_timer, but it's unclear if we want it | 106 # We have an implementation of idle_timer, but it's unclear if we want it |
| 107 # yet, so it's commented out for now. Leave this 'unported'. | 107 # yet, so it's commented out for now. Leave this 'unported'. |
| 108 'idletimer_unittest.cc', | 108 'idletimer_unittest.cc', |
| 109 | 109 |
| 110 'gfx/native_theme_unittest.cc', | 110 'gfx/native_theme_unittest.cc', |
| 111 ] | 111 ] |
| 112 for remove in to_be_ported_files: | 112 for remove in to_be_ported_files: |
| 113 input_files.remove(remove) | 113 input_files.remove(remove) |
| 114 | 114 |
| 115 if env['PLATFORM'] == 'darwin': | 115 if env.Bit('mac'): |
| 116 # Remove files that still need to be ported from the input_files list. | 116 # Remove files that still need to be ported from the input_files list. |
| 117 # TODO(port): delete files from this list as they get ported. | 117 # TODO(port): delete files from this list as they get ported. |
| 118 to_be_ported_files = [ | 118 to_be_ported_files = [ |
| 119 'process_util_unittest.cc', | 119 'process_util_unittest.cc', |
| 120 'stats_table_unittest.cc', | 120 'stats_table_unittest.cc', |
| 121 ] | 121 ] |
| 122 for remove in to_be_ported_files: | 122 for remove in to_be_ported_files: |
| 123 input_files.remove(remove) | 123 input_files.remove(remove) |
| 124 | 124 |
| 125 | 125 |
| 126 if env['PLATFORM'] == 'win32': | 126 if env.Bit('windows'): |
| 127 # Windows-specific tests. | 127 # Windows-specific tests. |
| 128 input_files.extend([ | 128 input_files.extend([ |
| 129 'directory_watcher_unittest.cc', | 129 'directory_watcher_unittest.cc', |
| 130 'file_version_info_unittest.cc', | 130 'file_version_info_unittest.cc', |
| 131 'object_watcher_unittest.cc', | 131 'object_watcher_unittest.cc', |
| 132 'pe_image_unittest.cc', | 132 'pe_image_unittest.cc', |
| 133 'sys_string_conversions_unittest.cc', | 133 'sys_string_conversions_unittest.cc', |
| 134 'time_unittest_win.cc', | 134 'time_unittest_win.cc', |
| 135 'win_util_unittest.cc', | 135 'win_util_unittest.cc', |
| 136 'wmi_util_unittest.cc', | 136 'wmi_util_unittest.cc', |
| 137 ]) | 137 ]) |
| 138 | 138 |
| 139 if env['PLATFORM'] == 'darwin': | 139 if env.Bit('mac'): |
| 140 # Mac-specific tests. | 140 # Mac-specific tests. |
| 141 input_files.extend([ | 141 input_files.extend([ |
| 142 'mac_util_unittest.cc', | 142 'mac_util_unittest.cc', |
| 143 ]) | 143 ]) |
| 144 | 144 |
| 145 env.ChromeTestProgram('base_unittests', input_files) | 145 env.ChromeTestProgram('base_unittests', input_files) |
| 146 | 146 |
| 147 # TODO(sgk) should this be moved into base.lib like everything else? This will | 147 # TODO(sgk) should this be moved into base.lib like everything else? This will |
| 148 # require updating a bunch of other SConscripts which link directly against | 148 # require updating a bunch of other SConscripts which link directly against |
| 149 # this generated object file. | 149 # this generated object file. |
| 150 env.StaticObject('perftimer.cc') | 150 env.StaticObject('perftimer.cc') |
| 151 | 151 |
| 152 # Since run_all_perftests supplies a main, we cannot have it in base.lib | 152 # Since run_all_perftests supplies a main, we cannot have it in base.lib |
| 153 env.StaticObject('run_all_perftests.cc') | 153 env.StaticObject('run_all_perftests.cc') |
| OLD | NEW |