summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorncbray@chromium.org <ncbray@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-14 14:22:42 +0000
committerncbray@chromium.org <ncbray@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-14 14:24:39 +0000
commit3de013990b3fa79ff720374d4af0a551e0a2f819 (patch)
treef185d937934f6b3f040b2e88f5d93758397c0281 /testing
parent646a59f71ce328a37b07d545fde68fea8758ec76 (diff)
downloadchromium_src-3de013990b3fa79ff720374d4af0a551e0a2f819.zip
chromium_src-3de013990b3fa79ff720374d4af0a551e0a2f819.tar.gz
chromium_src-3de013990b3fa79ff720374d4af0a551e0a2f819.tar.bz2
Create NaCl build of gtest.
Originally landed as 289216 and reverted as 289223 due to a GYP bug. BUG=401761 Review URL: https://codereview.chromium.org/401453002 Cr-Commit-Position: refs/heads/master@{#289558} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'testing')
-rw-r--r--testing/gtest.gyp38
-rw-r--r--testing/gtest.gypi41
-rw-r--r--testing/gtest_nacl.gyp90
3 files changed, 135 insertions, 34 deletions
diff --git a/testing/gtest.gyp b/testing/gtest.gyp
index f4577df..671a508 100644
--- a/testing/gtest.gyp
+++ b/testing/gtest.gyp
@@ -3,46 +3,16 @@
# found in the LICENSE file.
{
+ 'includes': [
+ 'gtest.gypi',
+ ],
'targets': [
{
'target_name': 'gtest',
'toolsets': ['host', 'target'],
'type': 'static_library',
'sources': [
- 'gtest/include/gtest/gtest-death-test.h',
- 'gtest/include/gtest/gtest-message.h',
- 'gtest/include/gtest/gtest-param-test.h',
- 'gtest/include/gtest/gtest-printers.h',
- 'gtest/include/gtest/gtest-spi.h',
- 'gtest/include/gtest/gtest-test-part.h',
- 'gtest/include/gtest/gtest-typed-test.h',
- 'gtest/include/gtest/gtest.h',
- 'gtest/include/gtest/gtest_pred_impl.h',
- 'gtest/include/gtest/internal/gtest-death-test-internal.h',
- 'gtest/include/gtest/internal/gtest-filepath.h',
- 'gtest/include/gtest/internal/gtest-internal.h',
- 'gtest/include/gtest/internal/gtest-linked_ptr.h',
- 'gtest/include/gtest/internal/gtest-param-util-generated.h',
- 'gtest/include/gtest/internal/gtest-param-util.h',
- 'gtest/include/gtest/internal/gtest-port.h',
- 'gtest/include/gtest/internal/gtest-string.h',
- 'gtest/include/gtest/internal/gtest-tuple.h',
- 'gtest/include/gtest/internal/gtest-type-util.h',
- 'gtest/src/gtest-all.cc',
- 'gtest/src/gtest-death-test.cc',
- 'gtest/src/gtest-filepath.cc',
- 'gtest/src/gtest-internal-inl.h',
- 'gtest/src/gtest-port.cc',
- 'gtest/src/gtest-printers.cc',
- 'gtest/src/gtest-test-part.cc',
- 'gtest/src/gtest-typed-test.cc',
- 'gtest/src/gtest.cc',
- 'multiprocess_func_list.cc',
- 'multiprocess_func_list.h',
- 'platform_test.h',
- ],
- 'sources!': [
- 'gtest/src/gtest-all.cc', # Not needed by our build.
+ '<@(gtest_sources)',
],
'include_dirs': [
'gtest',
diff --git a/testing/gtest.gypi b/testing/gtest.gypi
new file mode 100644
index 0000000..ca12e1b
--- /dev/null
+++ b/testing/gtest.gypi
@@ -0,0 +1,41 @@
+# Copyright 2014 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.
+
+{
+ 'variables': {
+ 'gtest_sources': [
+ 'gtest/include/gtest/gtest-death-test.h',
+ 'gtest/include/gtest/gtest-message.h',
+ 'gtest/include/gtest/gtest-param-test.h',
+ 'gtest/include/gtest/gtest-printers.h',
+ 'gtest/include/gtest/gtest-spi.h',
+ 'gtest/include/gtest/gtest-test-part.h',
+ 'gtest/include/gtest/gtest-typed-test.h',
+ 'gtest/include/gtest/gtest.h',
+ 'gtest/include/gtest/gtest_pred_impl.h',
+ 'gtest/include/gtest/gtest_prod.h',
+ 'gtest/include/gtest/internal/gtest-death-test-internal.h',
+ 'gtest/include/gtest/internal/gtest-filepath.h',
+ 'gtest/include/gtest/internal/gtest-internal.h',
+ 'gtest/include/gtest/internal/gtest-linked_ptr.h',
+ 'gtest/include/gtest/internal/gtest-param-util-generated.h',
+ 'gtest/include/gtest/internal/gtest-param-util.h',
+ 'gtest/include/gtest/internal/gtest-port.h',
+ 'gtest/include/gtest/internal/gtest-string.h',
+ 'gtest/include/gtest/internal/gtest-tuple.h',
+ 'gtest/include/gtest/internal/gtest-type-util.h',
+ 'gtest/src/gtest-death-test.cc',
+ 'gtest/src/gtest-filepath.cc',
+ 'gtest/src/gtest-internal-inl.h',
+ 'gtest/src/gtest-port.cc',
+ 'gtest/src/gtest-printers.cc',
+ 'gtest/src/gtest-test-part.cc',
+ 'gtest/src/gtest-typed-test.cc',
+ 'gtest/src/gtest.cc',
+ 'multiprocess_func_list.cc',
+ 'multiprocess_func_list.h',
+ 'platform_test.h',
+ ],
+ },
+}
diff --git a/testing/gtest_nacl.gyp b/testing/gtest_nacl.gyp
new file mode 100644
index 0000000..697217c
--- /dev/null
+++ b/testing/gtest_nacl.gyp
@@ -0,0 +1,90 @@
+# Copyright 2014 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.
+
+{
+ 'variables': {
+ 'chromium_code': 1,
+ },
+ 'includes': [
+ '../build/common_untrusted.gypi',
+ 'gtest.gypi',
+ ],
+ 'conditions': [
+ ['disable_nacl==0 and disable_nacl_untrusted==0', {
+ 'targets': [
+ {
+ 'target_name': 'gtest_nacl',
+ 'type': 'none',
+ 'variables': {
+ 'nlib_target': 'libgtest_nacl.a',
+ 'build_glibc': 0,
+ 'build_newlib': 1,
+ 'build_pnacl_newlib': 0,
+ },
+ 'sources': [
+ '<@(gtest_sources)',
+ ],
+ 'include_dirs': [
+ 'gtest',
+ 'gtest/include',
+ ],
+ 'defines': [
+ # In order to allow regex matches in gtest to be shared between
+ # Windows and other systems, we tell gtest to always use it's
+ # internal engine.
+ 'GTEST_HAS_POSIX_RE=0',
+ 'GTEST_LANG_CXX11=0',
+ # gtest isn't able to figure out when RTTI is disabled for gcc
+ # versions older than 4.3.2, and assumes it's enabled. Our Mac
+ # and Linux builds disable RTTI, and cannot guarantee that the
+ # compiler will be 4.3.2. or newer. The Mac, for example, uses
+ # 4.2.1 as that is the latest available on that platform. gtest
+ # must be instructed that RTTI is disabled here, and for any
+ # direct dependents that might include gtest headers.
+ 'GTEST_HAS_RTTI=0',
+ ],
+ 'all_dependent_settings': {
+ 'defines': [
+ 'GTEST_HAS_POSIX_RE=0',
+ 'GTEST_LANG_CXX11=0',
+ ],
+ 'link_flags': [
+ '-lgtest_nacl',
+ ],
+ },
+ 'direct_dependent_settings': {
+ 'defines': [
+ 'UNIT_TEST',
+ 'GTEST_HAS_RTTI=0',
+ ],
+ 'include_dirs': [
+ 'gtest/include', # So that gtest headers can find themselves.
+ ],
+ },
+ },
+ {
+ 'target_name': 'gtest_main_nacl',
+ 'type': 'none',
+ 'variables': {
+ 'nlib_target': 'libgtest_main_nacl.a',
+ 'build_glibc': 0,
+ 'build_newlib': 1,
+ 'build_pnacl_newlib': 0,
+ },
+ 'dependencies': [
+ 'gtest_nacl',
+ ],
+ 'sources': [
+ 'gtest/src/gtest_main.cc',
+ ],
+ 'all_dependent_settings': {
+ 'link_flags': [
+ '-lgtest_main_nacl',
+ ],
+ },
+ },
+ ],
+ }],
+ ],
+}