summaryrefslogtreecommitdiffstats
path: root/sandbox/tests
diff options
context:
space:
mode:
authorsgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-27 16:11:15 +0000
committersgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-27 16:11:15 +0000
commit93723b5339a6f238745c7445665276aa1e1f8bda (patch)
treed3b78e2041cab3cfe36582409d9a301410b20565 /sandbox/tests
parent6d68331166aa8e283c254cd6d83057541b74e9fc (diff)
downloadchromium_src-93723b5339a6f238745c7445665276aa1e1f8bda.zip
chromium_src-93723b5339a6f238745c7445665276aa1e1f8bda.tar.gz
chromium_src-93723b5339a6f238745c7445665276aa1e1f8bda.tar.bz2
Fix SCons build of the sandbox module, splitting out the individual
targets into the new *.scons file naming scheme. Review URL: http://codereview.chromium.org/8616 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4000 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/tests')
-rw-r--r--sandbox/tests/common/sandbox_common.scons29
-rw-r--r--sandbox/tests/integration_tests/sbox_integration_tests.scons81
-rw-r--r--sandbox/tests/unit_tests/sbox_unittests.scons79
-rw-r--r--sandbox/tests/validation_tests/sbox_validation_tests.scons74
4 files changed, 263 insertions, 0 deletions
diff --git a/sandbox/tests/common/sandbox_common.scons b/sandbox/tests/common/sandbox_common.scons
new file mode 100644
index 0000000..afd36a0
--- /dev/null
+++ b/sandbox/tests/common/sandbox_common.scons
@@ -0,0 +1,29 @@
+# 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.
+
+Import('env')
+
+env = env.Clone()
+
+env.Prepend(
+ CPPPATH = [
+ '$CHROME_SRC_DIR',
+ ],
+ CPPDEFINES = [
+ 'CHROMIUM_BUILD',
+ ],
+)
+
+if env['PLATFORM'] == 'win32':
+ env.Append(
+ CPPDEFINES = [
+ '_SECURE_ATL',
+ '_WINDOWS',
+ ],
+ CCFLAGS = [
+ '/WX', # treat warnings as errors
+ ],
+ )
+
+env.StaticObject('controller.cc')
diff --git a/sandbox/tests/integration_tests/sbox_integration_tests.scons b/sandbox/tests/integration_tests/sbox_integration_tests.scons
new file mode 100644
index 0000000..13476d1
--- /dev/null
+++ b/sandbox/tests/integration_tests/sbox_integration_tests.scons
@@ -0,0 +1,81 @@
+# 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.
+
+Import('env')
+
+env = env.Clone()
+
+env.SConscript([
+ '$BASE_DIR/using_base.scons',
+ '$GTEST_DIR/../using_gtest.scons',
+ '$SANDBOX_DIR/using_sandbox.scons',
+], {'env':env})
+
+env.Prepend(
+ CPPPATH = [
+ '$CHROME_SRC_DIR',
+ ],
+ CPPDEFINES = [
+ 'CHROMIUM_BUILD',
+ ],
+)
+
+if env['PLATFORM'] == 'win32':
+ env.Append(
+ CPPDEFINES = [
+ '_SECURE_ATL',
+ '_WINDOWS',
+ ],
+ CCFLAGS = [
+ '/TP',
+ '/WX', # treat warnings as errors
+ ],
+ )
+
+env.Prepend(
+ LINKFLAGS = [
+ '/DELAYLOAD:dwmapi.dll',
+ '/DELAYLOAD:uxtheme.dll',
+ '/MACHINE:X86',
+ '/FIXED:No',
+ '/safeseh',
+ '/dynamicbase',
+ '/ignore:4199',
+ '/nxcompat',
+ ],
+)
+
+
+
+# TODO(bradnelson): This step generates integration_tests.pch.ib_tag
+# SCons doesn't know.
+env_p = env.Clone()
+pch, obj = env_p.PCH(['integration_tests.pch', 'integration_tests.obj'],
+ 'integration_tests.cc')
+env['PCH'] = pch
+env['PCHSTOP'] = 'stdafx.h'
+env.Append(CCPCHFLAGS = ['/FIstdafx.h'])
+
+
+input_files = [
+ obj,
+ 'integration_tests_test.cc',
+
+# '$SANDBOX_DIR/src/dep_test.cc',
+ '$SANDBOX_DIR/src/file_policy_test.cc',
+ '$SANDBOX_DIR/src/integrity_level_test.cc',
+ '$SANDBOX_DIR/src/ipc_ping_test.cc',
+ '$SANDBOX_DIR/src/named_pipe_policy_test.cc',
+ '$SANDBOX_DIR/src/policy_target_test.cc',
+ '$SANDBOX_DIR/src/process_policy_test.cc',
+ '$SANDBOX_DIR/src/registry_policy_test.cc',
+ '$SANDBOX_DIR/src/sync_policy_test.cc',
+ '$SANDBOX_DIR/src/unload_dll_test.cc',
+
+ '../common/controller$OBJSUFFIX',
+]
+
+integration_tests = env.ChromeTestProgram('sbox_integration_tests', input_files)
+i = env.Install('$TARGET_ROOT', integration_tests)
+env.Alias('sandbox', i)
diff --git a/sandbox/tests/unit_tests/sbox_unittests.scons b/sandbox/tests/unit_tests/sbox_unittests.scons
new file mode 100644
index 0000000..2ce1759
--- /dev/null
+++ b/sandbox/tests/unit_tests/sbox_unittests.scons
@@ -0,0 +1,79 @@
+# 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.
+
+Import('env')
+
+env = env.Clone()
+
+env.SConscript([
+ '$BASE_DIR/using_base.scons',
+ '$GTEST_DIR/../using_gtest.scons',
+ '$SANDBOX_DIR/using_sandbox.scons',
+], {'env':env})
+
+env.Prepend(
+ CPPPATH = [
+ '$CHROME_SRC_DIR',
+ ],
+ CPPDEFINES = [
+ 'CHROMIUM_BUILD',
+ ],
+)
+
+if env['PLATFORM'] == 'win32':
+ env.Append(
+ CPPDEFINES = [
+ '_SECURE_ATL',
+ '_WINDOWS',
+ ],
+ CCFLAGS = [
+ '/TP',
+ '/WX', # treat warnings as errors
+ ],
+ )
+
+env.Prepend(
+ LINKFLAGS = [
+ '/DELAYLOAD:dwmapi.dll',
+ '/DELAYLOAD:uxtheme.dll',
+ '/MACHINE:X86',
+ '/FIXED:No',
+ '/safeseh',
+ '/dynamicbase',
+ '/ignore:4199',
+ '/nxcompat',
+ ],
+)
+
+
+# TODO(bradnelson): This step generates unittests_tests.pch.ib_tag
+# SCons doesn't know.
+env_p = env.Clone()
+pch, obj = env_p.PCH(['unit_tests.pch', 'unit_tests.obj'],
+ 'unit_tests.cc')
+env['PCH'] = pch
+env['PCHSTOP'] = 'stdafx.h'
+env.Append(CCPCHFLAGS = ['/FIstdafx.h'])
+
+input_files = [
+ obj,
+
+ '$SANDBOX_DIR/src/interception_unittest.cc',
+ '$SANDBOX_DIR/src/ipc_unittest.cc',
+ '$SANDBOX_DIR/src/job_unittest.cc',
+ '$SANDBOX_DIR/src/pe_image_unittest.cc',
+ '$SANDBOX_DIR/src/policy_engine_unittest.cc',
+ '$SANDBOX_DIR/src/policy_low_level_unittest.cc',
+ '$SANDBOX_DIR/src/policy_opcodes_unittest.cc',
+ '$SANDBOX_DIR/src/restricted_token_unittest.cc',
+ '$SANDBOX_DIR/src/service_resolver_unittest.cc',
+ '$SANDBOX_DIR/src/sid_unittest.cc',
+ '$SANDBOX_DIR/src/threadpool_unittest.cc',
+
+ '../common/controller$OBJSUFFIX',
+]
+
+sbox_unittests = env.ChromeTestProgram('sbox_unittests', input_files)
+i = env.Install('$TARGET_ROOT', sbox_unittests)
+env.Alias('sandbox', i)
diff --git a/sandbox/tests/validation_tests/sbox_validation_tests.scons b/sandbox/tests/validation_tests/sbox_validation_tests.scons
new file mode 100644
index 0000000..38b488b
--- /dev/null
+++ b/sandbox/tests/validation_tests/sbox_validation_tests.scons
@@ -0,0 +1,74 @@
+# 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.
+
+Import('env')
+
+env = env.Clone()
+
+env.SConscript([
+ '$BASE_DIR/using_base.scons',
+ '$GTEST_DIR/../using_gtest.scons',
+ '$SANDBOX_DIR/using_sandbox.scons',
+], {'env':env})
+
+env.Prepend(
+ CPPPATH = [
+ '$CHROME_SRC_DIR',
+ ],
+ CPPDEFINES = [
+ 'CHROMIUM_BUILD',
+ ],
+)
+
+if env['PLATFORM'] == 'win32':
+ env.Append(
+ CPPDEFINES = [
+ '_SECURE_ATL',
+ '_WINDOWS',
+ ],
+ CCFLAGS = [
+ '/TP',
+ '/WX', # treat warnings as errors
+ ],
+ )
+
+env.Prepend(
+ LINKFLAGS = [
+ '/DELAYLOAD:dwmapi.dll',
+ '/DELAYLOAD:uxtheme.dll',
+ '/MACHINE:X86',
+ '/FIXED:No',
+ '/safeseh',
+ '/dynamicbase',
+ '/ignore:4199',
+ '/nxcompat',
+ ],
+ LIBS = [
+ 'shlwapi',
+ ],
+)
+
+
+# TODO(bradnelson): This step generates unittests_tests.pch.ib_tag
+# SCons doesn't know.
+env_p = env.Clone()
+pch, obj = env_p.PCH(['unit_tests.pch', 'unit_tests.obj'],
+ 'unit_tests.cc')
+env['PCH'] = pch
+env['PCHSTOP'] = 'stdafx.h'
+env.Append(CCPCHFLAGS = ['/FIstdafx.h'])
+
+
+input_files = [
+ obj,
+
+ 'suite.cc',
+ 'commands.cc',
+
+ '../common/controller$OBJSUFFIX',
+]
+
+validation_tests = env.ChromeTestProgram('sbox_validation_tests', input_files)
+i = env.Install('$TARGET_ROOT', validation_tests)
+env.Alias('sandbox', i)