From be168aca851e70f07f1007dba70ed2beb07354f3 Mon Sep 17 00:00:00 2001 From: Nikita Kniazev Date: Sat, 20 Apr 2024 23:35:34 +0300 Subject: [PATCH] Default to Clang on FreeBSD and OpenBSD (#369) * FreeBSD since 2012: https://lists.freebsd.org/pipermail/freebsd-current/2012-September/036480.html * OpenBSD since 2017-2020: https://marc.info/?l=openbsd-cvs&m=150109829003860 --- src/build-system.jam | 2 +- test/BoostBuild.py | 2 +- test/default_toolset.py | 16 ++++++++++------ test/test_all.py | 3 +-- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/build-system.jam b/src/build-system.jam index bc8fea9faf..1f6c72b1e4 100644 --- a/src/build-system.jam +++ b/src/build-system.jam @@ -642,7 +642,7 @@ local rule should-clean-project ( project ) { default-toolset = vmsdecc ; } - else if [ os.name ] = MACOSX + else if [ os.name ] = MACOSX || [ os.name ] = FREEBSD || [ os.name ] = OPENBSD { default-toolset = clang ; } diff --git a/test/BoostBuild.py b/test/BoostBuild.py index 3942c00567..2c0e79e28d 100644 --- a/test/BoostBuild.py +++ b/test/BoostBuild.py @@ -105,7 +105,7 @@ def get_toolset(): if sys.platform == "win32": return "msvc" - if sys.platform == "darwin" or sys.platform.startswith("freebsd"): + if sys.platform == "darwin" or sys.platform.startswith("freebsd") or sys.platform.startswith("openbsd"): return "clang" return "gcc" diff --git a/test/default_toolset.py b/test/default_toolset.py index 791dad0c41..b7863dfe4e 100755 --- a/test/default_toolset.py +++ b/test/default_toolset.py @@ -36,7 +36,7 @@ def test_conditions_on_default_toolset(): be used by Boost Build. """ - t = BoostBuild.Tester("--user-config= --ignore-site-config", + t = BoostBuild.Tester(["--user-config=", "--ignore-site-config"], pass_toolset=False, use_test_config=False) toolset_name = "myCustomTestToolset" @@ -120,7 +120,7 @@ def test_default_toolset_on_os( os, expected_toolset ): important internal Boost Build state. """ - t = BoostBuild.Tester("--user-config= --ignore-site-config", + t = BoostBuild.Tester(["--user-config=", "--ignore-site-config"], pass_toolset=False, use_test_config=False) t.write("jamroot.jam", "modules.poke os : .name : %s ;" % os) @@ -128,7 +128,7 @@ def test_default_toolset_on_os( os, expected_toolset ): # We need to tell the test system to ignore stderr output as attempting to # load missing toolsets might cause random failures with which we are not # concerned in this test. - t.run_build_system(stderr=None) + t.run_build_system(status=None, stderr=None) t.expect_output_lines(configuring_default_toolset_message % expected_toolset) @@ -146,7 +146,7 @@ def test_default_toolset_requirements(): """Test that default toolset's requirements get applied correctly. """ - t = BoostBuild.Tester("--user-config= --ignore-site-config", + t = BoostBuild.Tester(["--user-config=", "--ignore-site-config"], pass_toolset=False, use_test_config=False, ignore_toolset_requirements=False) @@ -210,6 +210,10 @@ def test_default_toolset_requirements(): test_default_toolset_on_os("NT" , "msvc") test_default_toolset_on_os("LINUX" , "gcc" ) test_default_toolset_on_os("CYGWIN" , "gcc" ) +test_default_toolset_on_os("MACOSX" , "clang" ) +test_default_toolset_on_os("FREEBSD" , "clang" ) +test_default_toolset_on_os("OPENBSD" , "clang" ) test_default_toolset_on_os("SomeOtherOS", "gcc" ) -test_default_toolset_requirements() -test_conditions_on_default_toolset() +#test_default_toolset_requirements() +# FIXME: Failure of this test seems to indicate subfeatures matching issue +#test_conditions_on_default_toolset() diff --git a/test/test_all.py b/test/test_all.py index c33e2f231f..24b234f91e 100755 --- a/test/test_all.py +++ b/test/test_all.py @@ -285,8 +285,7 @@ def reorder_tests(tests, first_test): # "debugger-mi", "default_build", "default_features", -# This test is known to be broken itself. -# "default_toolset", + "default_toolset", "dependency_property", "dependency_test", "disambiguation",