2014-12-12 11:48:42 -08:00
|
|
|
|
#!/usr/bin/env python
|
win: Dynamically disable WoW64 tests absent explicit 32-bit build output
Rather than having the 64-bit build assume that it lives in
out\{Debug,Release}_x64 and that it can find 32-bit build output in
out\{Debug,Release}, require the location of 32-bit build output to be
provided explicitly via the CRASHPAD_TEST_32_BIT_OUTPUT environment
variable. If this variable is not set, 64-bit tests that require 32-bit
test build output will dynamically disable themselves at runtime.
In order for this to work, a new DISABLED_TEST() macro is added to
support dynamically disabled tests. gtest does not have its own
first-class support for this
(https://groups.google.com/d/topic/googletestframework/Nwh3u7YFuN4,
https://github.com/google/googletest/issues/490) so this local solution
is used instead.
For tests via Crashpad’s own build\run_tests.py, which is how Crashpad’s
own buildbots and trybots invoke tests, CRASHPAD_TEST_32_BIT_OUTPUT is
set to a locaton compatible with the paths expected for the GYP-based
build. No test coverage is lost on Crashpad’s own buildbots and trybots.
For Crashpad tests in Chromium’s buildbots and trybots, this environment
variable will not be set, causing these tests to be dynamically
disabled.
Bug: crashpad:203, chromium:743139, chromium:777924
Change-Id: I3c0de2bf4f835e13ed5a4adda5760d6fed508126
Reviewed-on: https://chromium-review.googlesource.com/739795
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-10-26 13:48:01 -04:00
|
|
|
|
# coding: utf-8
|
2014-12-12 11:48:42 -08:00
|
|
|
|
|
|
|
|
|
# Copyright 2014 The Crashpad Authors. All rights reserved.
|
|
|
|
|
#
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
|
#
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
#
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
2017-11-29 13:26:55 -05:00
|
|
|
|
from __future__ import print_function
|
|
|
|
|
|
2014-12-12 11:48:42 -08:00
|
|
|
|
import os
|
|
|
|
|
import subprocess
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# This script is primarily used from the waterfall so that the list of tests
|
|
|
|
|
# that are run is maintained in-tree, rather than in a separate infrastructure
|
|
|
|
|
# location in the recipe.
|
|
|
|
|
def main(args):
|
|
|
|
|
if len(args) != 1:
|
2017-11-29 13:26:55 -05:00
|
|
|
|
print('usage: run_tests.py <binary_dir>', file=sys.stderr)
|
2015-09-18 16:06:05 -07:00
|
|
|
|
return 1
|
2014-12-12 17:16:11 -05:00
|
|
|
|
|
|
|
|
|
crashpad_dir = \
|
|
|
|
|
os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir)
|
2017-03-21 20:52:50 -04:00
|
|
|
|
binary_dir = args[0]
|
2015-03-09 16:14:47 -04:00
|
|
|
|
|
win: Dynamically disable WoW64 tests absent explicit 32-bit build output
Rather than having the 64-bit build assume that it lives in
out\{Debug,Release}_x64 and that it can find 32-bit build output in
out\{Debug,Release}, require the location of 32-bit build output to be
provided explicitly via the CRASHPAD_TEST_32_BIT_OUTPUT environment
variable. If this variable is not set, 64-bit tests that require 32-bit
test build output will dynamically disable themselves at runtime.
In order for this to work, a new DISABLED_TEST() macro is added to
support dynamically disabled tests. gtest does not have its own
first-class support for this
(https://groups.google.com/d/topic/googletestframework/Nwh3u7YFuN4,
https://github.com/google/googletest/issues/490) so this local solution
is used instead.
For tests via Crashpad’s own build\run_tests.py, which is how Crashpad’s
own buildbots and trybots invoke tests, CRASHPAD_TEST_32_BIT_OUTPUT is
set to a locaton compatible with the paths expected for the GYP-based
build. No test coverage is lost on Crashpad’s own buildbots and trybots.
For Crashpad tests in Chromium’s buildbots and trybots, this environment
variable will not be set, causing these tests to be dynamically
disabled.
Bug: crashpad:203, chromium:743139, chromium:777924
Change-Id: I3c0de2bf4f835e13ed5a4adda5760d6fed508126
Reviewed-on: https://chromium-review.googlesource.com/739795
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-10-26 13:48:01 -04:00
|
|
|
|
# Tell 64-bit Windows tests where to find 32-bit test executables, for
|
|
|
|
|
# cross-bitted testing. This relies on the fact that the GYP build by default
|
|
|
|
|
# uses {Debug,Release} for the 32-bit build and {Debug,Release}_x64 for the
|
|
|
|
|
# 64-bit build. This is not a universally valid assumption, and if it’s not
|
|
|
|
|
# met, 64-bit tests that require 32-bit build output will disable themselves
|
|
|
|
|
# dynamically.
|
|
|
|
|
if (sys.platform == 'win32' and binary_dir.endswith('_x64') and
|
|
|
|
|
'CRASHPAD_TEST_32_BIT_OUTPUT' not in os.environ):
|
|
|
|
|
binary_dir_32 = binary_dir[:-4]
|
|
|
|
|
if os.path.isdir(binary_dir_32):
|
|
|
|
|
os.environ['CRASHPAD_TEST_32_BIT_OUTPUT'] = binary_dir_32
|
|
|
|
|
|
2014-12-12 11:48:42 -08:00
|
|
|
|
tests = [
|
2015-03-08 16:25:34 -04:00
|
|
|
|
'crashpad_client_test',
|
2017-11-02 11:55:44 -04:00
|
|
|
|
'crashpad_handler_test',
|
2015-03-08 16:25:34 -04:00
|
|
|
|
'crashpad_minidump_test',
|
|
|
|
|
'crashpad_snapshot_test',
|
test: Move util/test to its own top-level directory, test.
After 9e79ea1da719, it no longer makes sense for crashpad_util_test_lib
to “hide” in util/util_test.gyp. All of util/test is moved to its own
top-level directory, test, which all other test code is allowed to
depend on. test, too, is allowed to depend on all other non-test code.
In a future change, when crashpad_util_test_lib gains a dependency on
crashpad_client, it won’t look so weird for something in util (even
though it’s in util/test) to depend on something in client, because the
thing that needs to depend on client will live in test, not util.
BUG=crashpad:33
R=scottmg@chromium.org
Review URL: https://codereview.chromium.org/1051533002
2015-03-31 17:44:14 -04:00
|
|
|
|
'crashpad_test_test',
|
2015-03-08 16:25:34 -04:00
|
|
|
|
'crashpad_util_test',
|
2014-12-12 11:48:42 -08:00
|
|
|
|
]
|
2017-04-11 14:48:10 -04:00
|
|
|
|
|
2014-12-12 11:48:42 -08:00
|
|
|
|
for test in tests:
|
2017-11-29 13:26:55 -05:00
|
|
|
|
print('-' * 80)
|
|
|
|
|
print(test)
|
|
|
|
|
print('-' * 80)
|
2014-12-12 11:48:42 -08:00
|
|
|
|
subprocess.check_call(os.path.join(binary_dir, test))
|
2015-10-08 21:09:40 -07:00
|
|
|
|
|
|
|
|
|
if sys.platform == 'win32':
|
2017-03-21 20:52:50 -04:00
|
|
|
|
script = 'snapshot/win/end_to_end_test.py'
|
2017-11-29 13:26:55 -05:00
|
|
|
|
print('-' * 80)
|
|
|
|
|
print(script)
|
|
|
|
|
print('-' * 80)
|
2015-10-08 21:09:40 -07:00
|
|
|
|
subprocess.check_call(
|
2017-03-21 20:52:50 -04:00
|
|
|
|
[sys.executable, os.path.join(crashpad_dir, script), binary_dir])
|
2015-10-08 21:09:40 -07:00
|
|
|
|
|
2014-12-12 11:48:42 -08:00
|
|
|
|
return 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
sys.exit(main(sys.argv[1:]))
|