From 15677743003dd9ac8877aeeb3f58353b8eaf7aa4 Mon Sep 17 00:00:00 2001 From: memsharded Date: Tue, 28 Feb 2023 23:07:29 +0100 Subject: [PATCH 1/2] remove detect of msvc compiler.runtime_type --- conans/client/conf/detect.py | 1 - 1 file changed, 1 deletion(-) diff --git a/conans/client/conf/detect.py b/conans/client/conf/detect.py index 2be8f4e133c..156e38d7fed 100644 --- a/conans/client/conf/detect.py +++ b/conans/client/conf/detect.py @@ -224,7 +224,6 @@ def _detect_compiler_version(result): # Add default mandatory fields for MSVC compiler result.append(("compiler.cppstd", "14")) result.append(("compiler.runtime", "dynamic")) - result.append(("compiler.runtime_type", "Release")) if compiler != "msvc": cppstd = _cppstd_default(compiler, version) From a564f935293a43d93b32675bade019e488a5ffbf Mon Sep 17 00:00:00 2001 From: memsharded Date: Tue, 28 Feb 2023 23:11:37 +0100 Subject: [PATCH 2/2] test --- conans/test/functional/command/profile_test.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/conans/test/functional/command/profile_test.py b/conans/test/functional/command/profile_test.py index 2f3cf355839..d34537120b3 100644 --- a/conans/test/functional/command/profile_test.py +++ b/conans/test/functional/command/profile_test.py @@ -10,7 +10,7 @@ from conans.test.utils.mocks import RedirectedTestOutput from conans.test.utils.tools import TestClient, redirect_output from conans.util.env import environment_update -from conans.util.files import load, save +from conans.util.files import save from conans.util.runners import check_output_runner @@ -118,12 +118,13 @@ def test_detect_default_in_mac_os_using_gcc_as_default(self): self.assertIn("gcc detected as a frontend using apple-clang", output) def test_profile_new(self): - client = TestClient() + c = TestClient() + c.run("profile detect --name=./MyProfile2") + profile = c.load("MyProfile2") + assert "os=" in profile + assert "compiler.runtime_type" not in profile # Even in Windows - client.run("profile detect --name=./MyProfile2") - pr_path = os.path.join(client.current_folder, "MyProfile2") - self.assertTrue(os.path.exists(os.path.join(client.current_folder, "MyProfile2"))) - self.assertIn("os=", load(pr_path)) + c.run("profile detect --name=./MyProfile2", assert_error=True) + assert "MyProfile2' already exists" in c.out - client.run("profile detect --name=./MyProfile2", assert_error=True) - self.assertIn("MyProfile2' already exists", client.out) + c.run("profile detect --name=./MyProfile2 --force") # will not raise error