]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/test_all.py
fe97acd1a4d342d9f0c2f0ba77d51c750ad3818d
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_split_by_characters",
182 "conditionals_multiple",
185 "core_action_output",
186 "core_action_status",
187 "core_actions_quietly",
191 "core_multifile_actions",
196 "core_parallel_actions",
197 "core_parallel_multifile_actions_1",
198 "core_parallel_multifile_actions_2",
199 "core_source_line_tracking",
201 "core_variables_in_actions",
207 # This test is known to be broken itself.
209 "dependency_property",
211 "direct_request_test",
222 "free_features_request",
223 "generator_selection",
225 "implicit_dependency",
226 "indirect_conditional",
228 "inherited_dependency",
230 "lib_source_property",
246 "project_dependencies",
249 "project_root_constants",
253 "property_expansion",
257 "remove_requirement",
260 "scanner_causing_rebuilds",
269 "static_and_shared_library",
272 "test_result_dumping",
276 "toolset_requirements",
286 if os
.name
== "posix":
287 tests
.append("symlink")
288 # On Windows, library order is not important, so skip this test. Besides,
289 # it fails ;-). Further, the test relies on the fact that on Linux, one can
290 # build a shared library with unresolved symbols. This is not true on
291 # Windows, even with cygwin gcc.
293 # Disable this test until we figure how to address failures due to --as-needed being default now.
294 # if "CYGWIN" not in os.uname()[0]:
295 # tests.append("library_order")
297 if toolset
.startswith("gcc"):
298 tests
.append("gcc_runtime")
300 if toolset
.startswith("gcc") or toolset
.startswith("msvc"):
303 # Disable on OSX as it doesn't seem to work for unknown reasons.
304 if sys
.platform
!= 'darwin':
305 tests
.append("builtin_glob_archive")
307 if "--extras" in sys
.argv
:
308 tests
.append("boostbook")
311 tests
.append("example_qt4")
312 # Requires ./whatever.py to work, so is not guaranted to work everywhere.
313 tests
.append("example_customization")
314 # Requires gettext tools.
315 tests
.append("example_gettext")
317 print("Note: skipping extra tests")
319 run_tests(critical_tests
, tests
)