2014-12-12 11:48:42 -08:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
|
|
|
|
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-03-21 20:52:50 -04:00
|
|
|
print >> sys.stderr, 'usage: run_tests.py <binary_dir>'
|
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
|
|
|
|
2014-12-12 11:48:42 -08:00
|
|
|
tests = [
|
2015-03-08 16:25:34 -04:00
|
|
|
'crashpad_client_test',
|
|
|
|
'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
|
|
|
|
|
|
|
if sys.platform == 'win32':
|
|
|
|
tests.append('crashpad_handler_test')
|
|
|
|
tests = sorted(tests)
|
|
|
|
|
2014-12-12 11:48:42 -08:00
|
|
|
for test in tests:
|
|
|
|
print '-' * 80
|
|
|
|
print test
|
|
|
|
print '-' * 80
|
|
|
|
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'
|
2015-10-08 21:09:40 -07:00
|
|
|
print '-' * 80
|
2017-03-21 20:52:50 -04:00
|
|
|
print script
|
2015-10-08 21:09:40 -07:00
|
|
|
print '-' * 80
|
|
|
|
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:]))
|