Skip to content

Commit

Permalink
- add test for CMake helper and MSBuild verbosity
Browse files Browse the repository at this point in the history
Signed-off-by: SSE4 <tomskside@gmail.com>
  • Loading branch information
SSE4 committed Jan 13, 2019
1 parent e8b0420 commit e9f2b8c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion conans/client/build/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def _build(self, args=None, build_dir=None, target=None):
compiler_version and Version(compiler_version) >= "10":
if "--" not in args:
args.append("--")
args.append("/verbosity:%s" % self.msbuild_verbosity)
args.append("/verbosity:%s" % self.msbuild_verbosity)

arg_list = join_arguments([
args_to_string([build_dir]),
Expand Down
25 changes: 25 additions & 0 deletions conans/test/unittests/client/build/cmake_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1160,3 +1160,28 @@ def test_vcvars_applied(self, generator, compiler, version):
vcvars_mock.__exit__ = mock.MagicMock(return_value=None)
cmake.build()
self.assertTrue(vcvars_mock.called, "vcvars weren't called")

def test_msbuild_verbosity(self):
settings = Settings.loads(default_settings_yml)
settings.os = "Windows"
settings.compiler = "Visual Studio"
settings.compiler.version = "10"
settings.compiler.runtime = "MDd"
settings.arch = "x86"
settings.build_type = None

conan_file = ConanFileMock()
conan_file.settings = settings

cmake = CMake(conan_file)
cmake.build()
self.assertIn("/verbosity:minimal", conan_file.command)

cmake = CMake(conan_file, msbuild_verbosity="quiet")
cmake.build()
self.assertIn("/verbosity:quiet", conan_file.command)

with tools.environment_append({"CONAN_MSBUILD_VERBOSITY": "detailed"}):
cmake = CMake(conan_file)
cmake.build()
self.assertIn("/verbosity:detailed", conan_file.command)

0 comments on commit e9f2b8c

Please sign in to comment.