# 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.ApplySConscript([ '$BASE_DIR/using_base.scons', '$BASE_DIR/gfx/using_base_gfx.scons', '$GTEST_DIR/../using_gtest.scons', '$ICU38_DIR/using_icu38.scons', '$LIBJPEG_DIR/using_libjpeg.scons', '$LIBPNG_DIR/using_libpng.scons', '$SKIA_DIR/using_skia.scons', '$ZLIB_DIR/using_zlib.scons', ]) if env.Bit('posix'): env.ApplySConscript([ '$LIBEVENT_DIR/using_libevent.scons', ]) if env.Bit('windows'): env.Prepend( CCFLAGS = [ '/TP', '/WX', ], ) if env.Bit('linux'): env.Append( # We need 'Xss' (X Screen Saver) in LIBS if we want idletimer_unittest LIBS = [ 'event', ], ) input_files = ChromeFileList([ # TODO(sgk): # We're deliberately mis-indenting the MSVSFilter() calls here # so we don't have to re-indent the file name entries when the # MSVSFilter() calls go away in (favor of automated generation # of the heirarchy). MSVSFilter('support', [ 'multiprocess_test.h', 'no_windows2000_unittest.h', 'perf_test_suite.h', 'run_all_unittests.cc', 'test_suite.h', ]), MSVSFilter('base_tests', [ 'at_exit_unittest.cc', 'atomicops_unittest.cc', 'clipboard_unittest.cc', 'command_line_unittest.cc', 'condition_variable_unittest.cc', 'directory_watcher_unittest.cc', 'field_trial_unittest.cc', 'file_path_unittest.cc', 'file_util_unittest.cc', 'file_version_info_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', 'gfx/native_theme_unittest.cc', 'object_watcher_unittest.cc', 'observer_list_unittest.cc', 'path_service_unittest.cc', 'pe_image_unittest.cc', 'pickle_unittest.cc', 'pr_time_unittest.cc', 'process_util_unittest.cc', 'rand_util_unittest.cc', 'gfx/rect_unittest.cc', 'ref_counted_unittest.cc', 'scoped_bstr_win_unittest.cc', 'scoped_comptr_win_unittest.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', 'sys_string_conversions_unittest.cc', 'system_monitor_unittest.cc', 'thread_collision_warner_unittest.cc', 'thread_local_storage_unittest.cc', 'thread_local_unittest.cc', 'thread_unittest.cc', 'time_unittest.cc', 'time_win_unittest.cc', 'timer_unittest.cc', 'tracked_objects_unittest.cc', 'tuple_unittest.cc', 'values_unittest.cc', 'version_unittest.cc', 'waitable_event_unittest.cc', 'waitable_event_watcher_unittest.cc', 'watchdog_unittest.cc', 'win_util_unittest.cc', 'wmi_util_unittest.cc', 'word_iterator_unittest.cc', ]), MSVSFilter('gfx_tests', [ 'gfx/jpeg_codec_unittest.cc', 'gfx/png_codec_unittest.cc', ]), ]) if env.Bit('posix'): # Remove files that still need to be ported from the input_files list. # TODO(port): delete files from this list as they get ported. input_files.Remove( # 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', 'gfx/native_theme_unittest.cc', ) if env.Bit('linux'): input_files.Append( 'data_pack_unittest.cc', ) if env.Bit('mac'): # Remove files that still need to be ported from the input_files list. # TODO(port): delete files from this list as they get ported. input_files.Remove( 'process_util_unittest.cc', 'stats_table_unittest.cc', ) if not env.Bit('windows'): # Remove Windows-specific tests. input_files.Remove( 'directory_watcher_unittest.cc', 'file_version_info_unittest.cc', 'object_watcher_unittest.cc', 'pe_image_unittest.cc', 'scoped_bstr_win_unittest.cc', 'scoped_comptr_win_unittest.cc', 'system_monitor_unittest.cc', 'sys_string_conversions_unittest.cc', 'time_win_unittest.cc', 'win_util_unittest.cc', 'wmi_util_unittest.cc', ) if env.Bit('mac'): # Mac-specific tests. input_files.Extend([ 'mac_util_unittest.cc', ]) env.ChromeTestProgram('base_unittests', input_files) p = env.ChromeMSVSProject('build/base_unittests.vcproj', dest='$CHROME_SRC_DIR/base/build/base_unittests.vcproj', guid='{27A30967-4BBA-48D1-8522-CDE95F7B1CEC}', dependencies=[ '$BASE_DIR/build/base.vcproj', '$ZLIB_DIR/zlib.vcproj', '$ICU38_DIR/build/icu.vcproj', '$BASE_DIR/build/base_gfx.vcproj', '$TESTING_DIR/gtest.vcproj', '$LIBPNG_DIR/libpng.vcproj', '$SKIA_DIR/skia.vcproj', ], files=input_files, tools = [ 'VCPreBuildEventTool', 'VCCustomBuildTool', 'VCXMLDataGeneratorTool', 'VCWebServiceProxyGeneratorTool', 'VCMIDLTool', MSVSTool('VCCLCompilerTool', PreprocessorDefinitions='UNIT_TEST'), 'VCManagedResourceCompilerTool', 'VCResourceCompilerTool', 'VCPreLinkEventTool', 'VCLinkerTool', 'VCALinkTool', 'VCManifestTool', 'VCXDCMakeTool', 'VCBscMakeTool', 'VCFxCopTool', 'VCAppVerifierTool', 'VCWebDeploymentTool', 'VCPostBuildEventTool', ]) p.AddConfig('Debug|Win32', ConfigurationType = '1', InheritedPropertySheets = [ '$(SolutionDir)../build/debug.vsprops', './base_unittests.vsprops', '$(SolutionDir)../testing/using_gtest.vsprops', ]) p.AddConfig('Release|Win32', ConfigurationType = '1', InheritedPropertySheets = [ '$(SolutionDir)../build/release.vsprops', './base_unittests.vsprops', '$(SolutionDir)../testing/using_gtest.vsprops', ]) # 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')