Adding in most of the unit tests. This adds 406 of our unit tests

into the gyp build.  21 of them fail, but that is only because they don't
have test input yet -- I haven't added the build code that copies
the test inputs into the build dir yet.
Review URL: http://codereview.chromium.org/147129

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19778 0039d316-1c4b-4281-b951-d872f2087c98
Esse commit está contido em:
gspencer@google.com
2009-07-01 22:30:03 +00:00
commit 9f960d975b
13 arquivos alterados com 178 adições e 115 exclusões
+1
Ver Arquivo
@@ -23,6 +23,7 @@
'../converter/converter.gyp:*',
'../core/core.gyp:*',
'../import/import.gyp:*',
'../tests/tests.gyp:*',
'../plugin/idl/idl.gyp:*',
'../plugin/plugin.gyp:*',
'../serializer/serializer.gyp:*',
+2 -2
Ver Arquivo
@@ -34,7 +34,7 @@
'dummy_file_that_never_gets_built_so_scons_always_runs',
],
'action': [
'python',
'C:/Python24/python.exe',
'<@(_inputs)',
'--output="<(nacl_output_dir)"',
'--configuration="<(CONFIGURATION)"',
@@ -43,7 +43,7 @@
],
},
],
'direct_dependent_settings': {
'all_dependent_settings': {
'include_dirs': [
'<(nacldir)',
],
+62 -57
Ver Arquivo
@@ -35,6 +35,7 @@
'../../<(pngdir)/libpng.gyp:libpng',
'../../<(zlibdir)/zlib.gyp:zlib',
'../../skia/skia.gyp:skia',
'../build/nacl.gyp:build_nacl',
],
'sources': [
'cross/bitmap.cc',
@@ -267,63 +268,6 @@
],
],
},
{
'target_name': 'o3dCoreTest',
'type': 'static_library',
'dependencies': [
],
'sources': [
'cross/bitmap_test.cc',
'cross/bounding_box_test.cc',
'cross/buffer_test.cc',
'cross/class_manager_test.cc',
'cross/client_test.cc',
'cross/counter_test.cc',
'cross/curve_test.cc',
'cross/draw_element_test.cc',
'cross/draw_list_test.cc',
'cross/draw_pass_test.cc',
'cross/effect_test.cc',
'cross/element_test.cc',
'cross/features_test.cc',
'cross/field_test.cc',
'cross/float_n_test.cc',
'cross/function_test.cc',
'cross/material_test.cc',
'cross/math_utilities_test.cc',
'cross/matrix4_axis_rotation_test.cc',
'cross/matrix4_composition_test.cc',
'cross/matrix4_scale_test.cc',
'cross/matrix4_translation_test.cc',
# TODO(gspencer): fix this test so it can be re-enabled.
# 'cross/message_queue_test.cc',
'cross/object_base_test.cc',
'cross/pack_test.cc',
'cross/param_array_test.cc',
'cross/param_object_test.cc',
'cross/param_operation_test.cc',
'cross/param_test.cc',
'cross/performance_timer_test.cc',
'cross/primitive_test.cc',
'cross/ray_intersection_info_test.cc',
'cross/render_node_test.cc',
'cross/renderer_test.cc',
'cross/service_locator_test.cc',
'cross/shape_test.cc',
'cross/skin_test.cc',
'cross/smart_ptr_test.cc',
'cross/state_set_test.cc',
'cross/state_test.cc',
'cross/stream_bank_test.cc',
'cross/stream_test.cc',
'cross/transform_test.cc',
'cross/tree_traversal_test.cc',
'cross/vector_map_test.cc',
'cross/vertex_source_test.cc',
'cross/visitor_base_test.cc',
'cross/weak_ptr_test.cc',
],
},
{
'target_name': 'o3dCorePlatform',
'type': 'static_library',
@@ -395,5 +339,66 @@
],
],
},
{
'target_name': 'o3dCoreTest',
'type': 'none',
'dependencies': [
'o3dCore',
'o3dCorePlatform',
],
'direct_dependent_settings': {
'sources': [
'cross/bitmap_test.cc',
'cross/bounding_box_test.cc',
'cross/buffer_test.cc',
'cross/class_manager_test.cc',
'cross/client_test.cc',
'cross/counter_test.cc',
'cross/curve_test.cc',
'cross/draw_element_test.cc',
'cross/draw_list_test.cc',
'cross/draw_pass_test.cc',
'cross/effect_test.cc',
'cross/element_test.cc',
'cross/features_test.cc',
'cross/field_test.cc',
'cross/float_n_test.cc',
'cross/function_test.cc',
'cross/material_test.cc',
'cross/math_utilities_test.cc',
'cross/matrix4_axis_rotation_test.cc',
'cross/matrix4_composition_test.cc',
'cross/matrix4_scale_test.cc',
'cross/matrix4_translation_test.cc',
# TODO(gspencer): fix this test so it can be re-enabled.
# 'cross/message_queue_test.cc',
'cross/object_base_test.cc',
'cross/pack_test.cc',
'cross/param_array_test.cc',
'cross/param_object_test.cc',
'cross/param_operation_test.cc',
'cross/param_test.cc',
'cross/performance_timer_test.cc',
'cross/primitive_test.cc',
'cross/ray_intersection_info_test.cc',
'cross/render_node_test.cc',
'cross/renderer_test.cc',
'cross/service_locator_test.cc',
'cross/shape_test.cc',
'cross/skin_test.cc',
'cross/smart_ptr_test.cc',
'cross/state_set_test.cc',
'cross/state_test.cc',
'cross/stream_bank_test.cc',
'cross/stream_test.cc',
'cross/transform_test.cc',
'cross/tree_traversal_test.cc',
'cross/vector_map_test.cc',
'cross/vertex_source_test.cc',
'cross/visitor_base_test.cc',
'cross/weak_ptr_test.cc',
],
},
},
],
}
+2 -2
Ver Arquivo
@@ -254,7 +254,7 @@ class EffectParamSamplerArrayHandlerD3D9 : public EffectParamHandlerD3D9 {
<< "number of params in ParamArray does not match number of params "
<< "needed by shader array";
} else {
for (int i = 0; i < size; ++i) {
for (unsigned i = 0; i < size; ++i) {
SamplerUnitIndexArray& index_array = sampler_unit_index_arrays_[i];
Param* untyped_element = param->GetUntypedParam(i);
// TODO(gman): Make this check happen when building the param cache.
@@ -297,7 +297,7 @@ class EffectParamSamplerArrayHandlerD3D9 : public EffectParamHandlerD3D9 {
if (param) {
unsigned size = param->size();
if (size == sampler_unit_index_arrays_.size()) {
for (int i = 0; i < size; ++i) {
for (unsigned i = 0; i < size; ++i) {
SamplerUnitIndexArray& index_array = sampler_unit_index_arrays_[i];
Param* untyped_element = param->GetUntypedParam(i);
// TODO(gman): Make this check happen when building the param cache.
+3 -3
Ver Arquivo
@@ -233,7 +233,7 @@ TEST_F(MemoryStreamTest, EndianSanityFloat32) {
uint8 *p8 = reinterpret_cast<uint8*>(p);
MemoryWriteStream write_stream(p8, sizeof(int32) * 2);
float value = 3.14159;
float value = 3.14159f;
write_stream.WriteLittleEndianFloat32(value);
write_stream.WriteBigEndianFloat32(value);
@@ -261,9 +261,9 @@ TEST_F(MemoryStreamTest, EndianSanityFloat32) {
TEST_F(MemoryStreamTest, Endian) {
const int16 kValue1 = 13243;
const int32 kValue2 = 2393043;
const float kValue3 = -0.039483;
const float kValue3 = -0.039483f;
const int16 kValue4 = -3984;
const float kValue5 = 1234.5678;
const float kValue5 = 1234.5678f;
const uint8 kValue6 = 5; // write a single byte to make things interesting
const int32 kValue7 = -3920393;
+35
Ver Arquivo
@@ -126,5 +126,40 @@
],
],
},
{
'target_name': 'o3dImportTest',
'type': 'none',
'dependencies': [
'o3dArchive',
'o3dImport',
'../../<(antlrdir)/antlr.gyp:antlr3c',
'../../<(fcolladadir)/fcollada.gyp:fcollada',
'../../<(jpegdir)/libjpeg.gyp:libjpeg',
'../../<(pngdir)/libpng.gyp:libpng',
'../../<(zlibdir)/zlib.gyp:zlib',
],
'direct_dependent_settings': {
'sources': [
'cross/gz_compressor_test.cc',
'cross/gz_decompressor_test.cc',
'cross/memory_buffer_test.cc',
'cross/memory_stream_test.cc',
'cross/raw_data_test.cc',
'cross/tar_generator_test.cc',
'cross/tar_processor_test.cc',
'cross/targz_generator_test.cc',
'cross/targz_processor_test.cc',
],
'conditions' : [
['renderer == "d3d9" and OS == "win"',
{
'include_dirs': [
'$(DXSDK_DIR)/Include',
],
}
],
],
},
},
],
}
+14 -8
Ver Arquivo
@@ -21,6 +21,7 @@
'O3D_PLUGIN_MIME_TYPE="<!(python version_info.py --mimetype)"',
],
},
'targets': [
{
'target_name': 'npo3dautoplugin',
@@ -108,16 +109,21 @@
'msvs_settings': {
'VCLinkerTool': {
'AdditionalDependencies': [
'"$(DXSDK_DIR)/Lib/x86/DxErr9.lib"',
'"$(DXSDK_DIR)/Lib/x86/d3dx9.lib"',
'../../<(cgdir)/lib/cg.lib',
'../../<(cgdir)/lib/cgGL.lib',
'd3d9.lib',
'rpcrt4.lib',
],
# Set /SUBSYSTEM:CONSOLE for converter.exe, since
# it is a console app.
'SubSystem': '1',
},
},
},
],
['OS == "win" and renderer == "d3d9"',
{
'msvs_settings': {
'VCLinkerTool': {
'AdditionalDependencies': [
'"$(DXSDK_DIR)/Lib/x86/DxErr9.lib"',
'"$(DXSDK_DIR)/Lib/x86/d3dx9.lib"',
'd3d9.lib',
],
},
},
},
+1 -1
Ver Arquivo
@@ -47,7 +47,7 @@
#include "plugin/cross/plugin_logging.h"
#include "plugin/cross/out_of_memory.h"
#include "statsreport/metrics.h"
#include "third_party/v8/include/v8.h"
#include "v8/include/v8.h"
#include "breakpad/win/bluescreen_detector.h"
using glue::_o3d::PluginObject;
+8 -3
Ver Arquivo
@@ -30,10 +30,15 @@
},
{
'target_name': 'o3dSerializerTest',
'type': 'static_library',
'sources': [
'cross/serializer_test.cc',
'type': 'none',
'dependencies': [
'o3dSerializer',
],
'direct_dependent_settings': {
'sources': [
'cross/serializer_test.cc',
],
},
},
],
}
+29 -24
Ver Arquivo
@@ -84,33 +84,38 @@
},
{
'target_name': 'o3dStatsReportTest',
'type': 'static_library',
'sources': [
'aggregator-win32_unittest.cc',
'aggregator-win32_unittest.h',
'aggregator_unittest.cc',
'aggregator_unittest.h',
'common/highres_timer_unittest.cc',
'formatter_unittest.cc',
'metrics_unittest.cc',
'persistent_iterator-win32_unittest.cc',
'type': 'none',
'dependencies': [
'o3dStatsReport',
],
'conditions': [
['OS != "win"',
{
'sources/': [
['exclude', '(-win32)_unittest\.(cc|h)$'],
],
},
'direct_dependent_settings': {
'sources': [
'aggregator-win32_unittest.cc',
'aggregator-win32_unittest.h',
'aggregator_unittest.cc',
'aggregator_unittest.h',
'common/highres_timer_unittest.cc',
'formatter_unittest.cc',
'metrics_unittest.cc',
'persistent_iterator-win32_unittest.cc',
],
['OS != "mac"',
{
'sources/': [
['exclude', '(-mac)_unittest\.(cc|mm|h)$'],
],
},
'conditions': [
['OS != "win"',
{
'sources/': [
['exclude', '(-win32)_unittest\.(cc|h)$'],
],
},
],
['OS != "mac"',
{
'sources/': [
['exclude', '(-mac)_unittest\.(cc|mm|h)$'],
],
},
],
],
],
},
},
],
},
+6 -6
Ver Arquivo
@@ -153,12 +153,12 @@ if env.Bit('windows'):
env.Help('\n')
swiftshader_install = []
if env.Bit('windows'):
# Copy SwiftShader to plugin dir.
swiftshader_path = env.subst('$SWIFTSHADER_DIR/swiftshader_d3d9.dll')
if os.path.exists(swiftshader_path):
swiftshader_install = env.Replicate('$ARTIFACTS_DIR/O3DExtras',
swiftshader_path)
if env.Bit('windows'):
# Copy SwiftShader to plugin dir.
swiftshader_path = env.subst('$SWIFTSHADER_DIR/swiftshader_d3d9.dll')
if os.path.exists(swiftshader_path):
swiftshader_install = env.Replicate('$ARTIFACTS_DIR/O3DExtras',
swiftshader_path)
# -------------------------------------------------------------------------
# Unit tests
+2 -1
Ver Arquivo
@@ -160,7 +160,8 @@ int WINAPI WinMain(HINSTANCE instance,
display_window = display_window;
display_window->set_hwnd(g_window_handle);
g_display_window = display_window;
bool offscreen = ::GetEnvironmentVariableW(kOffScreenRenderer, NULL, 0);
bool offscreen = (::GetEnvironmentVariableW(kOffScreenRenderer,
NULL, 0) == 0);
if (offscreen) {
success =
g_renderer->Init(*g_display_window, true) == o3d::Renderer::SUCCESS;
+13 -8
Ver Arquivo
@@ -44,15 +44,20 @@
},
{
'target_name': 'o3dUtilsTest',
'type': 'static_library',
'sources': [
"cross/file_path_utils_test.cc",
"cross/file_text_reader_test.cc",
"cross/json_writer_test.cc",
"cross/string_reader_test.cc",
"cross/string_writer_test.cc",
"cross/temporary_file_test.cc",
'type': 'none',
'dependencies': [
'o3dUtils',
],
'direct_dependent_settings': {
'sources': [
"cross/file_path_utils_test.cc",
"cross/file_text_reader_test.cc",
"cross/json_writer_test.cc",
"cross/string_reader_test.cc",
"cross/string_writer_test.cc",
"cross/temporary_file_test.cc",
],
},
},
],
}