]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/test_all.py
56bcf72fdacb4a3b358a927c263eb2e8f5c5cbd4
3 # Copyright 2002-2005 Dave Abrahams.
4 # Copyright 2002-2006 Vladimir Prus.
5 # Distributed under the Boost Software License, Version 1.0.
6 # (See accompanying file LICENSE_1_0.txt or copy at
7 # http://www.boost.org/LICENSE_1_0.txt)
15 xml
= "--xml" in sys
.argv
16 toolset
= BoostBuild
.get_toolset()
19 # Clear environment for testing.
21 for s
in ("BOOST_ROOT", "BOOST_BUILD_PATH", "JAM_TOOLSET", "BCCROOT",
22 "MSVCDir", "MSVC", "MSVCNT", "MINGW", "watcom"):
28 BoostBuild
.set_defer_annotations(1)
31 def run_tests(critical_tests
, other_tests
):
33 Runs first the critical_tests and then the other_tests.
35 Writes the name of the first failed test to test_results.txt. Critical
36 tests are run in the specified order, other tests are run starting with the
37 one that failed first on the last test run.
40 last_failed
= last_failed_test()
41 other_tests
= reorder_tests(other_tests
, last_failed
)
42 all_tests
= critical_tests
+ other_tests
44 invocation_dir
= os
.getcwd()
45 max_test_name_len
= 10
47 if len(x
) > max_test_name_len
:
48 max_test_name_len
= len(x
)
53 for test
in all_tests
:
55 print("%%-%ds :" % max_test_name_len
% test
),
61 except KeyboardInterrupt:
62 """This allows us to abort the testing manually using Ctrl-C."""
65 """This is the regular way our test scripts are supposed to report
68 exc_type
, exc_value
, exc_tb
= sys
.exc_info()
70 BoostBuild
.annotation("failure - unhandled exception", "%s - "
71 "%s" % (exc_type
.__name
__, exc_value
))
72 BoostBuild
.annotate_stack_trace(exc_tb
)
74 # Explicitly clear a hard-to-garbage-collect traceback
75 # related reference cycle as per documented sys.exc_info()
83 if failures_count
== 1:
84 f
= open(os
.path
.join(invocation_dir
, "test_results.txt"), "w")
90 # Restore the current directory, which might have been changed by the
92 os
.chdir(invocation_dir
)
104 <test-log library="build" test-name="%s" test-type="run" toolset="%s" test-program="%s" target-directory="%s">
105 <run result="%s">""" % (test
, toolset
, "tools/build/v2/test/" + test
+ ".py",
106 "boost/bin.v2/boost.build.tests/" + toolset
+ "/" + test
, rs
)
108 BoostBuild
.flush_annotations(1)
113 sys
.stdout
.flush() # Makes testing under emacs more entertaining.
114 BoostBuild
.clear_annotations()
116 # Erase the file on success.
117 if failures_count
== 0:
118 open("test_results.txt", "w").close()
125 """ % (pass_count
, failures_count
)
127 # exit with failure with failures
128 if failures_count
> 0:
131 def last_failed_test():
132 "Returns the name of the last failed test or None."
134 f
= open("test_results.txt")
136 return f
.read().strip()
143 def reorder_tests(tests
, first_test
):
145 n
= tests
.index(first_test
)
146 return [first_test
] + tests
[:n
] + tests
[n
+ 1:]
151 critical_tests
= ["unit_tests", "module_actions", "startup_v2", "core_d12",
152 "core_typecheck", "core_delete_module", "core_language", "core_arguments",
153 "core_varnames", "core_import_module"]
155 # We want to collect debug information about the test site before running any
156 # of the tests, but only when not running the tests interactively. Then the
157 # user can easily run this always-failing test directly to see what it would
158 # have returned and there is no need to have it spoil a possible 'all tests
161 critical_tests
.insert(0, "collect_debug_info")
163 tests
= ["absolute_sources",
173 "builtin_glob_archive",
174 "builtin_split_by_characters",
183 "conditionals_multiple",
186 "core_action_output",
187 "core_action_status",
188 "core_actions_quietly",
192 "core_multifile_actions",
197 "core_parallel_actions",
198 "core_parallel_multifile_actions_1",
199 "core_parallel_multifile_actions_2",
200 "core_source_line_tracking",
202 "core_variables_in_actions",
206 # This test is known to be broken itself.
208 "dependency_property",
210 "direct_request_test",
221 "free_features_request",
222 "generator_selection",
224 "implicit_dependency",
225 "indirect_conditional",
227 "inherited_dependency",
229 "lib_source_property",
245 "project_dependencies",
248 "project_root_constants",
252 "property_expansion",
256 "remove_requirement",
259 "scanner_causing_rebuilds",
268 "static_and_shared_library",
271 "test_result_dumping",
275 "toolset_requirements",
285 if os
.name
== "posix":
286 tests
.append("symlink")
287 # On Windows, library order is not important, so skip this test. Besides,
288 # it fails ;-). Further, the test relies on the fact that on Linux, one can
289 # build a shared library with unresolved symbols. This is not true on
290 # Windows, even with cygwin gcc.
292 # Disable this test until we figure how to address failures due to --as-needed being default now.
293 # if "CYGWIN" not in os.uname()[0]:
294 # tests.append("library_order")
296 if toolset
.startswith("gcc"):
297 tests
.append("gcc_runtime")
299 if toolset
.startswith("gcc") or toolset
.startswith("msvc"):
302 if "--extras" in sys
.argv
:
303 tests
.append("boostbook")
306 tests
.append("example_qt4")
307 # Requires ./whatever.py to work, so is not guaranted to work everywhere.
308 tests
.append("example_customization")
309 # Requires gettext tools.
310 tests
.append("example_gettext")
312 print("Note: skipping extra tests")
314 run_tests(critical_tests
, tests
)