Repository: conan-io/conan

Issue:
Revisions: Manage non-pristine state in repo to capture the revision
What to do during the export if the SCM folder contains not committed changes?
Mark in metadata as "dirty" and forbid upload?
What if we enable `scm_mode` to `hash` but still using `scm` feature? #4413
What if we don't use `scm` feature but revisions?  Looks like it has to be marked as `dirty` both if we use the `scm_mode` as revisions mode and/or if we use the `scm` feature.

Discussion:

Patch:
diff --git a/conans/client/build/cmake.py b/conans/client/build/cmake.py
index 9c41dbbdb..aaf02a208 100644
--- a/conans/client/build/cmake.py
+++ b/conans/client/build/cmake.py
@@ -7,7 +7,7 @@ from conans.client import defs_to_string, join_arguments, tools
 from conans.client.build.cmake_flags import CMakeDefinitionsBuilder, \
     get_generator, is_multi_configuration, verbose_definition, verbose_definition_name, \
     cmake_install_prefix_var_name, get_toolset, build_type_definition, \
-    cmake_in_local_cache_var_name, runtime_definition_var_name
+    cmake_in_local_cache_var_name, runtime_definition_var_name, get_generator_platform
 from conans.errors import ConanException
 from conans.model.conan_file import ConanFile
 from conans.model.version import Version
@@ -20,7 +20,8 @@ class CMake(object):
 
     def __init__(self, conanfile, generator=None, cmake_system_name=True,
                  parallel=True, build_type=None, toolset=None, make_program=None,
-                 set_cmake_flags=False, msbuild_verbosity=None, cmake_program=None):
+                 set_cmake_flags=False, msbuild_verbosity=None, cmake_program=None,
+                 generator_platform=None):
         """
         :param conanfile: Conanfile instance
         :param generator: Generator name to use or none to autodetect
@@ -35,6 +36,7 @@ class CMake(object):
                 (e.g. using CMAKE_SIZEOF_VOID_P or CMAKE_LIBRARY_ARCHITECTURE)
         :param msbuild_verbosity: verbosity level for MSBuild (in case of Visual Studio generator)
         :param cmake_program: Path to the custom cmake executable
+        :param generator_platform: Generator platform name or none to autodetect (-A cmake option)
         """
         if not isinstance(conanfile, ConanFile):
             raise ConanException("First argument of CMake() has to be ConanFile. Use CMake(self)")
@@ -45,6 +47,7 @@ class CMake(object):
         self._cmake_program = os.getenv("CONAN_CMAKE_PROGRAM") or cmake_program or "cmake"
 
         self.generator = generator or get_generator(conanfile.settings)
+        self.generator_platform = generator_platform or get_generator_platform(conanfile.settings)
         if not self.generator:
             self._conanfile.output.warn("CMake generator could not be deduced from settings")
         self.parallel = parallel
@@ -109,6 +112,8 @@ class CMake(object):
     @property
     def command_line(self):
         args = ['-G "%s"' % self.generator] if self.generator else []
+        if self.generator_platform:
+            args.append('-A "%s"' % self.generator_platform)
         args.append(self.flags)
         args.append('-Wno-dev')
 
diff --git a/conans/client/build/cmake_flags.py b/conans/client/build/cmake_flags.py
index 536983239..757832834 100644
--- a/conans/client/build/cmake_flags.py
+++ b/conans/client/build/cmake_flags.py
@@ -8,6 +8,7 @@ from conans.client.tools import cross_building
 from conans.client.tools.oss import get_cross_building_settings
 from conans.errors import ConanException
 from conans.model.build_info import DEFAULT_BIN, DEFAULT_INCLUDE, DEFAULT_LIB, DEFAULT_SHARE
+from conans.model.version import Version
 from conans.util.env_reader import get_env
 from conans.util.log import logger
 
@@ -51,12 +52,12 @@ def get_generator(settings):
                     '16': '16 2019'}
         base = "Visual Studio %s" % _visuals.get(compiler_version,
                                                  "UnknownVersion %s" % compiler_version)
-        if arch == "x86_64":
-            return base + " Win64"
-        elif "arm" in arch:
-            return base + " ARM"
-        else:
-            return base
+        if Version(compiler_version) < "16":
+            if arch == "x86_64":
+                base += " Win64"
+            elif "arm" in arch:
+                base += " ARM"
+        return base
 
     # The generator depends on the build machine, not the target
     if os_build == "Windows":
@@ -65,6 +66,22 @@ def get_generator(settings):
     return "Unix Makefiles"
 
 
+def get_generator_platform(settings):
+    if "CONAN_CMAKE_GENERATOR_PLATFORM" in os.environ:
+        return os.environ["CONAN_CMAKE_GENERATOR_PLATFORM"]
+
+    compiler = settings.get_safe("compiler")
+    arch = settings.get_safe("arch")
+    compiler_version = settings.get_safe("compiler.version")
+
+    if compiler == "Visual Studio" and Version(compiler_version) >= "16":
+        return {"x86": "Win32",
+                "x86_64": "x64",
+                "armv7": "ARM",
+                "armv8": "ARM64"}.get(arch)
+    return None
+
+
 def is_multi_configuration(generator):
     if not generator:
         return False
diff --git a/conans/client/cmd/export.py b/conans/client/cmd/export.py
index 89c2efb0e..7bd0e0840 100644
--- a/conans/client/cmd/export.py
+++ b/conans/client/cmd/export.py
@@ -229,24 +229,26 @@ def _replace_scm_data_in_conanfile(conanfile_path, scm_data):
 
 def _detect_scm_revision(path):
     if not path:
-        return None, None
+        return None, None, None
 
     repo_type = SCM.detect_scm(path)
     if not repo_type:
-        return None, None
+        return None, None, None
 
     repo_obj = SCM.availables.get(repo_type)(path)
-    return repo_obj.get_revision(), repo_type
+    return repo_obj.get_revision(), repo_type, repo_obj.is_pristine()
 
 
 def _update_revision_in_metadata(package_layout, revisions_enabled, output, path, digest):
 
-    scm_revision_detected, repo_type = _detect_scm_revision(path)
+    scm_revision_detected, repo_type, is_pristine = _detect_scm_revision(path)
     revision = scm_revision_detected or digest.summary_hash
     if revisions_enabled:
         if scm_revision_detected:
             output.info("Using {} commit as the recipe"
                         " revision: {} ".format(repo_type, revision))
+            if not is_pristine:
+                output.warn("Repo status is not pristine: there might be modified files")
         else:
             output.info("Using the exported files summary hash as the recipe"
                         " revision: {} ".format(revision))
diff --git a/conans/client/conf/__init__.py b/conans/client/conf/__init__.py
index cab97be9d..d65109193 100644
--- a/conans/client/conf/__init__.py
+++ b/conans/client/conf/__init__.py
@@ -108,6 +108,7 @@ request_timeout = 60                  # environment CONAN_REQUEST_TIMEOUT (secon
 # conan_cmake_program = cmake         # environment CONAN_CMAKE_PROGRAM (overrides the make program used in CMake.cmake_program)
 
 # cmake_generator                     # environment CONAN_CMAKE_GENERATOR
+# cmake generator platform            # environment CONAN_CMAKE_GENERATOR_PLATFORM
 # http://www.vtk.org/Wiki/CMake_Cross_Compiling
 # cmake_toolchain_file                # environment CONAN_CMAKE_TOOLCHAIN_FILE
 # cmake_system_name                   # environment CONAN_CMAKE_SYSTEM_NAME
@@ -185,6 +186,7 @@ class ConanClientConfigParser(ConfigParser, object):
                "CONAN_VERBOSE_TRACEBACK": self._env_c("general.verbose_traceback", "CONAN_VERBOSE_TRACEBACK", None),
                # http://www.vtk.org/Wiki/CMake_Cross_Compiling
                "CONAN_CMAKE_GENERATOR": self._env_c("general.cmake_generator", "CONAN_CMAKE_GENERATOR", None),
+               "CONAN_CMAKE_GENERATOR_PLATFORM": self._env_c("general.cmake_generator_platform", "CONAN_CMAKE_GENERATOR_PLATFORM", None),
                "CONAN_CMAKE_TOOLCHAIN_FILE": self._env_c("general.cmake_toolchain_file", "CONAN_CMAKE_TOOLCHAIN_FILE", None),
                "CONAN_CMAKE_SYSTEM_NAME": self._env_c("general.cmake_system_name", "CONAN_CMAKE_SYSTEM_NAME", None),
                "CONAN_CMAKE_SYSTEM_VERSION": self._env_c("general.cmake_system_version", "CONAN_CMAKE_SYSTEM_VERSION", None),
diff --git a/conans/client/tools/files.py b/conans/client/tools/files.py
index 250a2c458..bfb968001 100644
--- a/conans/client/tools/files.py
+++ b/conans/client/tools/files.py
@@ -322,6 +322,7 @@ def collect_libs(conanfile, folder=None):
                                           "times with a different file extension" % name)
                 else:
                     result.append(name)
+    result.sort()
     return result
 
 
@@ -369,5 +370,3 @@ def unix2dos(filepath):
 
 def dos2unix(filepath):
     _replace_with_separator(filepath, "\n")
-
-
diff --git a/conans/client/tools/scm.py b/conans/client/tools/scm.py
index 806daec6d..193a082be 100644
--- a/conans/client/tools/scm.py
+++ b/conans/client/tools/scm.py
@@ -343,10 +343,11 @@ class SVN(SCMBase):
                         return False
                 return True
         else:
-            import warnings
-            warnings.warn("SVN::is_pristine for SVN v{} (less than {}) is not implemented, it is"
-                          " returning not-pristine always because it cannot compare with"
-                          " checked out version.".format(self.version, SVN.API_CHANGE_VERSION))
+            if self._output:
+                self._output.warn("SVN::is_pristine for SVN v{} (less than {}) is not implemented,"
+                                  " it is returning not-pristine always because it cannot compare"
+                                  " with checked out version.".format(self.version,
+                                                                      SVN.API_CHANGE_VERSION))
             return False
 
     def get_revision(self):
diff --git a/conans/client/tools/win.py b/conans/client/tools/win.py
index a2687c3a7..be06bb82f 100644
--- a/conans/client/tools/win.py
+++ b/conans/client/tools/win.py
@@ -137,9 +137,6 @@ def msvc_build_command(settings, sln_path, targets=None, upgrade_project=True, b
                        output=None):
     """ Do both: set the environment variables and call the .sln build
     """
-    import warnings
-    warnings.warn("deprecated", DeprecationWarning)
-
     vcvars = vcvars_command(settings, force=force_vcvars, output=output)
     build = build_sln_command(settings, sln_path, targets, upgrade_project, build_type, arch,
                               parallel, toolset=toolset, platforms=platforms, output=output)
diff --git a/conans/model/editable_layout.py b/conans/model/editable_layout.py
index 3164c43f5..de8a5f796 100644
--- a/conans/model/editable_layout.py
+++ b/conans/model/editable_layout.py
@@ -2,7 +2,7 @@
 import os
 from collections import OrderedDict
 
-from six import StringIO
+import six
 from six.moves import configparser
 
 from conans.errors import ConanException
@@ -59,7 +59,10 @@ class EditableLayout(object):
 
             parser = configparser.ConfigParser(allow_no_value=True)
             parser.optionxform = str
-            parser.readfp(StringIO(content))
+            if six.PY3:
+                parser.read_string(content)
+            else:
+                parser.readfp(six.StringIO(content))
         except (configparser.Error, ConanException) as e:
             raise ConanException("Error parsing layout file '%s' (for reference '%s')\n%s" %
                                  (self._filepath, str(ref), str(e)))
diff --git a/conans/model/env_info.py b/conans/model/env_info.py
index e7b0bc193..b84cd75db 100644
--- a/conans/model/env_info.py
+++ b/conans/model/env_info.py
@@ -254,7 +254,7 @@ class DepsEnvInfo(EnvInfo):
                 else:
                     self.vars[varname] = merge_lists(self.vars[varname], [value])
             else:
-                logger.warn("DISCARDED variable %s=%s from %s" % (varname, value, pkg_name))
+                logger.warning("DISCARDED variable %s=%s from %s" % (varname, value, pkg_name))
 
     def update_deps_env_info(self, dep_env_info):
         assert isinstance(dep_env_info, DepsEnvInfo)
diff --git a/conans/server/rest/bottle_plugins/authorization_header.py b/conans/server/rest/bottle_plugins/authorization_header.py
index f70e062a0..7ee988023 100644
--- a/conans/server/rest/bottle_plugins/authorization_header.py
+++ b/conans/server/rest/bottle_plugins/authorization_header.py
@@ -1,6 +1,7 @@
 import inspect
 from abc import ABCMeta, abstractmethod
 
+import six
 from bottle import PluginError, request
 
 from conans.util.log import logger
@@ -30,7 +31,8 @@ class AuthorizationHeader(object):
 
     def apply(self, callback, context):
         """ Test if the original callback accepts a 'self.keyword' keyword. """
-        args = inspect.getargspec(context.callback)[0]
+        args = inspect.getfullargspec(context.callback)[0] if six.PY3 \
+            else inspect.getargspec(context.callback)[0]
         logger.debug("Call: %s" % str(callback))
         if self.keyword not in args:
             return callback
diff --git a/conans/util/files.py b/conans/util/files.py
index 1046ea6b0..472fa854e 100644
--- a/conans/util/files.py
+++ b/conans/util/files.py
@@ -62,7 +62,7 @@ def decode_text(text):
             return text.decode(decoder)
         except UnicodeDecodeError:
             continue
-    logger.warn("can't decode %s" % str(text))
+    logger.warning("can't decode %s" % str(text))
     return text.decode("utf-8", "ignore")  # Ignore not compatible characters
 
 
diff --git a/conans/util/windows.py b/conans/util/windows.py
index 3cb9e2497..1b95ffe8f 100644
--- a/conans/util/windows.py
+++ b/conans/util/windows.py
@@ -74,7 +74,7 @@ def path_shortener(path, short_paths):
 
     redirect = hashed_redirect(short_home, path)
     if not redirect:
-        logger.warn("Failed to create a deterministic short path in %s", short_home)
+        logger.warning("Failed to create a deterministic short path in %s", short_home)
         redirect = tempfile.mkdtemp(dir=short_home, prefix="")
 
     # Save the full path of the local cache directory where the redirect is from.


Test patch:
diff --git a/conans/test/__init__.py b/conans/test/__init__.py
index 32f47da43..90bc78fb5 100644
--- a/conans/test/__init__.py
+++ b/conans/test/__init__.py
@@ -1,4 +1,8 @@
 import os
+import warnings
 
 CONAN_TEST_FOLDER = os.getenv('CONAN_TEST_FOLDER', None)
 os.environ["CONAN_RECIPE_LINTER"] = "False"
+
+# Enable warnings as errors only for `conan[s]` module
+warnings.filterwarnings("error", module="conan.*")
diff --git a/conans/test/integration/syncronize_test.py b/conans/test/integration/syncronize_test.py
index 7790d34f2..00b39be42 100644
--- a/conans/test/integration/syncronize_test.py
+++ b/conans/test/integration/syncronize_test.py
@@ -126,7 +126,7 @@ class SynchronizeTest(unittest.TestCase):
         # With revisions makes no sense because there is a new revision always that sources change
         if not client.cache.config.revisions_enabled:
             self.assertFalse(os.path.exists(remote_file_path))
-            self.assertNotEquals(remote_file_path, new_file_source_path)
+            self.assertNotEqual(remote_file_path, new_file_source_path)
 
     def _create_manifest(self, client, package_reference):
         # Create the manifest to be able to upload the package
diff --git a/conans/test/unittests/client/build/cmake_test.py b/conans/test/unittests/client/build/cmake_test.py
index 30b817523..b4da96c13 100644
--- a/conans/test/unittests/client/build/cmake_test.py
+++ b/conans/test/unittests/client/build/cmake_test.py
@@ -189,6 +189,91 @@ class CMakeTest(unittest.TestCase):
             cmake = CMake(conan_file)
             self.assertIn('-G "My CMake Generator"', cmake.command_line)
 
+    def cmake_generator_platform_test(self):
+        conan_file = ConanFileMock()
+        conan_file.settings = Settings()
+
+        with tools.environment_append({"CONAN_CMAKE_GENERATOR": "My CMake Generator",
+                                       "CONAN_CMAKE_GENERATOR_PLATFORM": "My CMake Platform"}):
+            cmake = CMake(conan_file)
+            self.assertIn('-G "My CMake Generator" -A "My CMake Platform"', cmake.command_line)
+
+    def cmake_generator_platform_override_test(self):
+        settings = Settings.loads(default_settings_yml)
+        settings.os = "Windows"
+        settings.compiler = "Visual Studio"
+        settings.compiler.version = "15"
+        settings.arch = "x86"
+
+        conan_file = ConanFileMock()
+        conan_file.settings = settings
+
+        with tools.environment_append({"CONAN_CMAKE_GENERATOR_PLATFORM": "Win64"}):
+            cmake = CMake(conan_file)
+            self.assertIn('-G "Visual Studio 15 2017" -A "Win64"', cmake.command_line)
+
+    def cmake_generator_platform_gcc_test(self):
+            settings = Settings.loads(default_settings_yml)
+            settings.os = "Linux"
+            settings.os_build = "Linux"
+            settings.compiler = "gcc"
+            settings.compiler.version = "8"
+            settings.compiler.libcxx = "libstdc++"
+            settings.arch = "x86"
+
+            conan_file = ConanFileMock()
+            conan_file.settings = settings
+
+            cmake = CMake(conan_file)
+            self.assertIn('-G "Unix Makefiles"', cmake.command_line)
+            self.assertNotIn('-A', cmake.command_line)
+
+    @parameterized.expand([('x86', 'Visual Studio 15 2017'),
+                           ('x86_64', 'Visual Studio 15 2017 Win64'),
+                           ('armv7', 'Visual Studio 15 2017 ARM')])
+    def cmake_generator_platform_vs2017_test(self, arch, generator):
+        settings = Settings.loads(default_settings_yml)
+        settings.os = "Windows"
+        settings.compiler = "Visual Studio"
+        settings.compiler.version = "15"
+        settings.arch = arch
+
+        conan_file = ConanFileMock()
+        conan_file.settings = settings
+
+        cmake = CMake(conan_file)
+        self.assertIn('-G "%s"' % generator, cmake.command_line)
+        self.assertNotIn('-A', cmake.command_line)
+
+    @parameterized.expand([('x86', 'Win32'),
+                           ('x86_64', 'x64'),
+                           ('armv7', 'ARM'),
+                           ('armv8', 'ARM64')])
+    def cmake_generator_platform_vs2019_test(self, arch, platform):
+        settings = Settings.loads(default_settings_yml)
+        settings.os = "Windows"
+        settings.compiler = "Visual Studio"
+        settings.compiler.version = "16"
+        settings.arch = arch
+
+        conan_file = ConanFileMock()
+        conan_file.settings = settings
+
+        cmake = CMake(conan_file)
+        self.assertIn('-G "Visual Studio 16 2019" -A "%s"' % platform, cmake.command_line)
+
+    @parameterized.expand([('arm',),
+                           ('ppc',),
+                           ('86',)])
+    def cmake_generator_platform_other_test(self, platform):
+        conan_file = ConanFileMock()
+        conan_file.settings = Settings()
+
+        with tools.environment_append({"CONAN_CMAKE_GENERATOR": "Green Hills MULTI",
+                                       "CONAN_CMAKE_GENERATOR_PLATFORM": platform}):
+            cmake = CMake(conan_file)
+            self.assertIn('-G "Green Hills MULTI" -A "%s"' % platform, cmake.command_line)
+
     def cmake_fpic_test(self):
         settings = Settings.loads(default_settings_yml)
         settings.os = "Linux"
diff --git a/conans/test/unittests/client/cmd/export/test_update_revision_in_metadata.py b/conans/test/unittests/client/cmd/export/test_update_revision_in_metadata.py
new file mode 100644
index 000000000..8ebfeee70
--- /dev/null
+++ b/conans/test/unittests/client/cmd/export/test_update_revision_in_metadata.py
@@ -0,0 +1,27 @@
+# coding=utf-8
+
+
+import unittest
+
+from mock import mock
+
+from conans.client.cmd.export import _update_revision_in_metadata
+from conans.model.ref import ConanFileReference
+from conans.paths.package_layouts.package_cache_layout import PackageCacheLayout
+from conans.test.utils.test_files import temp_folder
+from conans.test.utils.tools import TestBufferConanOutput
+
+
+class UpdateRevisionInMetadataTests(unittest.TestCase):
+
+    def test_warn_not_pristine(self):
+        output = TestBufferConanOutput()
+
+        with mock.patch("conans.client.cmd.export._detect_scm_revision",
+                        return_value=("revision", "git", False)):
+            path = digest = None
+            ref = ConanFileReference.loads("lib/version@user/channel")
+            package_layout = PackageCacheLayout(base_folder=temp_folder(), ref=ref,
+                                                short_paths=False, no_lock=True)
+            _update_revision_in_metadata(package_layout, True, output, path, digest)
+            self.assertIn("WARN: Repo status is not pristine: there might be modified files", output)
diff --git a/conans/test/unittests/model/build_info/cppflags_test.py b/conans/test/unittests/model/build_info/cppflags_test.py
index c702a6384..53fdce743 100644
--- a/conans/test/unittests/model/build_info/cppflags_test.py
+++ b/conans/test/unittests/model/build_info/cppflags_test.py
@@ -1,6 +1,8 @@
 # coding=utf-8
 
 import unittest
+import warnings
+
 from conans.model.build_info import _CppInfo
 
 
@@ -9,24 +11,38 @@ class CppFlagsTest(unittest.TestCase):
 
     def test_use_cxxflags(self):
         """ Changes in cxxflags get reflected in cppflags """
-        cpp_info = _CppInfo()
 
-        cpp_info.cxxflags = "flags"
-        self.assertEqual(cpp_info.cppflags, "flags")
-        self.assertEqual(cpp_info.cxxflags, cpp_info.cppflags)
+        with warnings.catch_warnings(record=True) as w:
+            warnings.simplefilter("always")
+
+            cpp_info = _CppInfo()
+            cpp_info.cxxflags = "flags"
+            self.assertEqual(cpp_info.cppflags, "flags")
+            self.assertEqual(cpp_info.cxxflags, cpp_info.cppflags)
 
-        cpp_info.cxxflags = None
-        self.assertEqual(cpp_info.cppflags, None)
-        self.assertEqual(cpp_info.cxxflags, cpp_info.cppflags)
+            cpp_info.cxxflags = None
+            self.assertEqual(cpp_info.cppflags, None)
+            self.assertEqual(cpp_info.cxxflags, cpp_info.cppflags)
+
+            self.assertEqual(len(w), 4)
+            self.assertTrue(issubclass(w[0].category, DeprecationWarning))
 
     def test_use_cppflags(self):
         """ Changes in cppflags get reflected in cxxflags """
-        cpp_info = _CppInfo()
 
-        cpp_info.cppflags = "flags"
-        self.assertEqual(cpp_info.cxxflags, "flags")
-        self.assertEqual(cpp_info.cxxflags, cpp_info.cppflags)
+        with warnings.catch_warnings(record=True) as w:
+            warnings.simplefilter("always")
+
+            cpp_info = _CppInfo()
+
+            cpp_info.cppflags = "flags"
+            self.assertEqual(cpp_info.cxxflags, "flags")
+            self.assertEqual(cpp_info.cxxflags, cpp_info.cppflags)
+
+            cpp_info.cppflags = None
+            self.assertEqual(cpp_info.cxxflags, None)
+            self.assertEqual(cpp_info.cxxflags, cpp_info.cppflags)
+
+            self.assertEqual(len(w), 4)
+            self.assertTrue(issubclass(w[0].category, DeprecationWarning))
 
-        cpp_info.cppflags = None
-        self.assertEqual(cpp_info.cxxflags, None)
-        self.assertEqual(cpp_info.cxxflags, cpp_info.cppflags)
diff --git a/conans/test/unittests/model/profile_test.py b/conans/test/unittests/model/profile_test.py
index 82c0c71b9..729c67516 100644
--- a/conans/test/unittests/model/profile_test.py
+++ b/conans/test/unittests/model/profile_test.py
@@ -48,10 +48,10 @@ compiler.runtime=MT
                                                  ("other", "value")]))
 
         self.assertEqual(dict(new_profile.settings), {"compiler": "Visual Studio",
-                                                       "os": "Windows",
-                                                       "compiler.runtime": "MT",
-                                                       "compiler.subsetting": "3",
-                                                       "other": "value"})
+                                                      "os": "Windows",
+                                                      "compiler.runtime": "MT",
+                                                      "compiler.subsetting": "3",
+                                                      "other": "value"})
 
     def package_settings_update_test(self):
         prof = '''[settings]
@@ -63,12 +63,12 @@ MyPackage:os=Windows
 
         np.update_package_settings({"MyPackage": [("OTHER", "2")]})
         self.assertEqual(np.package_settings_values,
-                          {"MyPackage": [("os", "Windows"), ("OTHER", "2")]})
+                         {"MyPackage": [("os", "Windows"), ("OTHER", "2")]})
 
         np.update_package_settings({"MyPackage": [("compiler", "2"), ("compiler.version", "3")]})
         self.assertEqual(np.package_settings_values,
-                          {"MyPackage": [("os", "Windows"), ("OTHER", "2"),
-                                         ("compiler", "2"), ("compiler.version", "3")]})
+                         {"MyPackage": [("os", "Windows"), ("OTHER", "2"),
+                                        ("compiler", "2"), ("compiler.version", "3")]})
 
     def profile_dump_order_test(self):
         # Settings
diff --git a/conans/test/unittests/util/build_sln_command_test.py b/conans/test/unittests/util/build_sln_command_test.py
index cd5364740..aeef5d8a7 100644
--- a/conans/test/unittests/util/build_sln_command_test.py
+++ b/conans/test/unittests/util/build_sln_command_test.py
@@ -3,6 +3,7 @@
 
 import os
 import unittest
+import warnings
 
 from nose.plugins.attrib import attr
 from six import StringIO
@@ -34,42 +35,76 @@ class BuildSLNCommandTest(unittest.TestCase):
         folder = temp_folder()
         path = os.path.join(folder, "dummy.sln")
         save(path, dummy)
-        new_out = StringIO()
-        command = build_sln_command(Settings({}), sln_path=path, targets=None, upgrade_project=False,
-                                    build_type='Debug', arch="x86", parallel=False,
-                                    output=ConanOutput(new_out))
+
+        with warnings.catch_warnings(record=True) as w:
+            warnings.simplefilter("always")
+
+            new_out = StringIO()
+            command = build_sln_command(Settings({}), sln_path=path, targets=None, upgrade_project=False,
+                                        build_type='Debug', arch="x86", parallel=False,
+                                        output=ConanOutput(new_out))
+
+            self.assertEqual(len(w), 1)
+            self.assertTrue(issubclass(w[0].category, DeprecationWarning))
+
         self.assertIn('/p:Configuration="Debug" /p:Platform="x86"', command)
         self.assertIn("WARN: ***** The configuration Debug|x86 does not exist in this solution *****",
                       new_out.getvalue())
 
         # use platforms
-        new_out = StringIO()
-        command = build_sln_command(Settings({}), sln_path=path, targets=None, upgrade_project=False,
-                                    build_type='Debug', arch="x86", parallel=False,
-                                    platforms={"x86": "Win32"}, output=ConanOutput(new_out))
+        with warnings.catch_warnings(record=True) as w:
+            warnings.simplefilter("always")
+
+            new_out = StringIO()
+            command = build_sln_command(Settings({}), sln_path=path, targets=None, upgrade_project=False,
+                                        build_type='Debug', arch="x86", parallel=False,
+                                        platforms={"x86": "Win32"}, output=ConanOutput(new_out))
+
+            self.assertEqual(len(w), 1)
+            self.assertTrue(issubclass(w[0].category, DeprecationWarning))
+
         self.assertIn('/p:Configuration="Debug" /p:Platform="Win32"', command)
         self.assertNotIn("WARN", new_out.getvalue())
         self.assertNotIn("ERROR", new_out.getvalue())
 
     def no_arch_test(self):
         with self.assertRaises(ConanException):
-            new_out = StringIO()
-            build_sln_command(Settings({}), sln_path='dummy.sln', targets=None,
-                              upgrade_project=False, build_type='Debug', arch=None, parallel=False,
-                              output=ConanOutput(new_out))
+            with warnings.catch_warnings(record=True) as w:
+                warnings.simplefilter("always")
+
+                new_out = StringIO()
+                build_sln_command(Settings({}), sln_path='dummy.sln', targets=None,
+                                  upgrade_project=False, build_type='Debug', arch=None, parallel=False,
+                                  output=ConanOutput(new_out))
+
+                self.assertEqual(len(w), 1)
+                self.assertTrue(issubclass(w[0].category, DeprecationWarning))
 
     def no_build_type_test(self):
         with self.assertRaises(ConanException):
-            new_out = StringIO()
-            build_sln_command(Settings({}), sln_path='dummy.sln', targets=None,
-                              upgrade_project=False, build_type=None, arch='x86', parallel=False,
-                              output=ConanOutput(new_out))
+            with warnings.catch_warnings(record=True) as w:
+                warnings.simplefilter("always")
+
+                new_out = StringIO()
+                build_sln_command(Settings({}), sln_path='dummy.sln', targets=None,
+                                  upgrade_project=False, build_type=None, arch='x86', parallel=False,
+                                  output=ConanOutput(new_out))
+
+                self.assertEqual(len(w), 1)
+                self.assertTrue(issubclass(w[0].category, DeprecationWarning))
 
     def positive_test(self):
-        output = ConanOutput(StringIO())
-        command = build_sln_command(Settings({}), sln_path='dummy.sln', targets=None,
-                                    upgrade_project=False, build_type='Debug', arch='x86',
-                                    parallel=False, output=output)
+        with warnings.catch_warnings(record=True) as w:
+            warnings.simplefilter("always")
+
+            output = ConanOutput(StringIO())
+            command = build_sln_command(Settings({}), sln_path='dummy.sln', targets=None,
+                                        upgrade_project=False, build_type='Debug', arch='x86',
+                                        parallel=False, output=output)
+
+            self.assertEqual(len(w), 1)
+            self.assertTrue(issubclass(w[0].category, DeprecationWarning))
+
         self.assertIn('msbuild "dummy.sln"', command)
         self.assertIn('/p:Platform="x86"', command)
         self.assertNotIn('devenv "dummy.sln" /upgrade', command)
@@ -77,10 +112,17 @@ class BuildSLNCommandTest(unittest.TestCase):
         self.assertNotIn('/target:teapot', command)
 
     def upgrade_test(self):
-        output = ConanOutput(StringIO())
-        command = build_sln_command(Settings({}), sln_path='dummy.sln', targets=None,
-                                    upgrade_project=True, build_type='Debug', arch='x86_64',
-                                    parallel=False, output=output)
+        with warnings.catch_warnings(record=True) as w:
+            warnings.simplefilter("always")
+
+            output = ConanOutput(StringIO())
+            command = build_sln_command(Settings({}), sln_path='dummy.sln', targets=None,
+                                        upgrade_project=True, build_type='Debug', arch='x86_64',
+                                        parallel=False, output=output)
+
+            self.assertEqual(len(w), 1)
+            self.assertTrue(issubclass(w[0].category, DeprecationWarning))
+
         self.assertIn('msbuild "dummy.sln"', command)
         self.assertIn('/p:Platform="x64"', command)
         self.assertIn('devenv "dummy.sln" /upgrade', command)
@@ -88,10 +130,17 @@ class BuildSLNCommandTest(unittest.TestCase):
         self.assertNotIn('/target:teapot', command)
 
         with tools.environment_append({"CONAN_SKIP_VS_PROJECTS_UPGRADE": "1"}):
-            output = ConanOutput(StringIO())
-            command = build_sln_command(Settings({}), sln_path='dummy.sln', targets=None,
-                                        upgrade_project=True, build_type='Debug', arch='x86_64',
-                                        parallel=False, output=output)
+            with warnings.catch_warnings(record=True) as w:
+                warnings.simplefilter("always")
+
+                output = ConanOutput(StringIO())
+                command = build_sln_command(Settings({}), sln_path='dummy.sln', targets=None,
+                                            upgrade_project=True, build_type='Debug', arch='x86_64',
+                                            parallel=False, output=output)
+
+                self.assertEqual(len(w), 1)
+                self.assertTrue(issubclass(w[0].category, DeprecationWarning))
+
             self.assertIn('msbuild "dummy.sln"', command)
             self.assertIn('/p:Platform="x64"', command)
             self.assertNotIn('devenv "dummy.sln" /upgrade', command)
@@ -99,17 +148,31 @@ class BuildSLNCommandTest(unittest.TestCase):
             self.assertNotIn('/target:teapot', command)
 
         with tools.environment_append({"CONAN_SKIP_VS_PROJECTS_UPGRADE": "False"}):
+            with warnings.catch_warnings(record=True) as w:
+                warnings.simplefilter("always")
+
+                output = ConanOutput(StringIO())
+                command = build_sln_command(Settings({}), sln_path='dummy.sln', targets=None,
+                                            upgrade_project=True, build_type='Debug', arch='x86_64',
+                                            parallel=False, output=output)
+
+                self.assertEqual(len(w), 1)
+                self.assertTrue(issubclass(w[0].category, DeprecationWarning))
+
+            self.assertIn('devenv "dummy.sln" /upgrade', command)
+
+    def parallel_test(self):
+        with warnings.catch_warnings(record=True) as w:
+            warnings.simplefilter("always")
+
             output = ConanOutput(StringIO())
             command = build_sln_command(Settings({}), sln_path='dummy.sln', targets=None,
-                                        upgrade_project=True, build_type='Debug', arch='x86_64',
+                                        upgrade_project=True, build_type='Debug', arch='armv7',
                                         parallel=False, output=output)
-            self.assertIn('devenv "dummy.sln" /upgrade', command)
 
-    def parallel_test(self):
-        output = ConanOutput(StringIO())
-        command = build_sln_command(Settings({}), sln_path='dummy.sln', targets=None,
-                                    upgrade_project=True, build_type='Debug', arch='armv7',
-                                    parallel=False, output=output)
+            self.assertEqual(len(w), 1)
+            self.assertTrue(issubclass(w[0].category, DeprecationWarning))
+
         self.assertIn('msbuild "dummy.sln"', command)
         self.assertIn('/p:Platform="ARM"', command)
         self.assertIn('devenv "dummy.sln" /upgrade', command)
@@ -117,10 +180,17 @@ class BuildSLNCommandTest(unittest.TestCase):
         self.assertNotIn('/target:teapot', command)
 
     def target_test(self):
-        output = ConanOutput(StringIO())
-        command = build_sln_command(Settings({}), sln_path='dummy.sln', targets=['teapot'],
-                                    upgrade_project=False, build_type='Debug', arch='armv8',
-                                    parallel=False, output=output)
+        with warnings.catch_warnings(record=True) as w:
+            warnings.simplefilter("always")
+
+            output = ConanOutput(StringIO())
+            command = build_sln_command(Settings({}), sln_path='dummy.sln', targets=['teapot'],
+                                        upgrade_project=False, build_type='Debug', arch='armv8',
+                                        parallel=False, output=output)
+
+            self.assertEqual(len(w), 1)
+            self.assertTrue(issubclass(w[0].category, DeprecationWarning))
+
         self.assertIn('msbuild "dummy.sln"', command)
         self.assertIn('/p:Platform="ARM64"', command)
         self.assertNotIn('devenv "dummy.sln" /upgrade', command)
@@ -128,15 +198,22 @@ class BuildSLNCommandTest(unittest.TestCase):
         self.assertIn('/target:teapot', command)
 
     def toolset_test(self):
-        new_out = StringIO()
-        command = build_sln_command(MockSettings({"compiler": "Visual Studio",
-                                                  "compiler.version": "17",
-                                                  "build_type": "Debug",
-                                                  "compiler.runtime": "MDd",
-                                                  "cppstd": "17"}),
-                                    sln_path='dummy.sln', targets=None,
-                                    upgrade_project=False, build_type='Debug', arch='armv7',
-                                    parallel=False, toolset="v110", output=ConanOutput(new_out))
+        with warnings.catch_warnings(record=True) as w:
+            warnings.simplefilter("always")
+
+            new_out = StringIO()
+            command = build_sln_command(MockSettings({"compiler": "Visual Studio",
+                                                      "compiler.version": "17",
+                                                      "build_type": "Debug",
+                                                      "compiler.runtime": "MDd",
+                                                      "cppstd": "17"}),
+                                        sln_path='dummy.sln', targets=None,
+                                        upgrade_project=False, build_type='Debug', arch='armv7',
+                                        parallel=False, toolset="v110", output=ConanOutput(new_out))
+
+            self.assertEqual(len(w), 1)
+            self.assertTrue(issubclass(w[0].category, DeprecationWarning))
+
         self.assertTrue(command.startswith('msbuild "dummy.sln" /p:Configuration="Debug" '
                                            '/p:Platform="ARM" '
                                            '/p:PlatformToolset="v110" '
@@ -144,15 +221,22 @@ class BuildSLNCommandTest(unittest.TestCase):
                                            '/p:ForceImportBeforeCppTargets='), command)
 
     def properties_file_test(self):
-        new_out = StringIO()
-        command = build_sln_command(MockSettings({"compiler": "Visual Studio",
-                                                  "compiler.version": "17",
-                                                  "build_type": "Debug",
-                                                  "compiler.runtime": "MDd",
-                                                  "cppstd": "17"}),
-                                    sln_path='dummy.sln', targets=None,
-                                    upgrade_project=False, build_type='Debug', arch='armv7',
-                                    parallel=False, output=ConanOutput(new_out))
+        with warnings.catch_warnings(record=True) as w:
+            warnings.simplefilter("always")
+
+            new_out = StringIO()
+            command = build_sln_command(MockSettings({"compiler": "Visual Studio",
+                                                      "compiler.version": "17",
+                                                      "build_type": "Debug",
+                                                      "compiler.runtime": "MDd",
+                                                      "cppstd": "17"}),
+                                        sln_path='dummy.sln', targets=None,
+                                        upgrade_project=False, build_type='Debug', arch='armv7',
+                                        parallel=False, output=ConanOutput(new_out))
+
+            self.assertEqual(len(w), 1)
+            self.assertTrue(issubclass(w[0].category, DeprecationWarning))
+
         self.assertTrue(command.startswith('msbuild "dummy.sln" /p:Configuration="Debug" '
                                            '/p:Platform="ARM" '
                                            '/verbosity:minimal '
diff --git a/conans/test/unittests/util/output_test.py b/conans/test/unittests/util/output_test.py
index 26f9a0359..26d6347d9 100644
--- a/conans/test/unittests/util/output_test.py
+++ b/conans/test/unittests/util/output_test.py
@@ -5,7 +5,6 @@ import unittest
 import zipfile
 
 import six
-from six import StringIO
 
 from conans.client import tools
 from conans.client.output import ConanOutput
@@ -18,7 +17,7 @@ from conans.util.files import load, save
 class OutputTest(unittest.TestCase):
 
     def simple_output_test(self):
-        stream = StringIO()
+        stream = six.StringIO()
         output = ConanOutput(stream)
         output.rewrite_line("This is a very long line that has to be truncated somewhere, "
                             "because it is so long it doesn't fit in the output terminal")
@@ -44,7 +43,7 @@ class PkgConan(ConanFile):
         self.assertIn("ENDTEXT", client.user_io.out)
 
     def print_progress_test(self):
-        stream = StringIO()
+        stream = six.StringIO()
         output = ConanOutput(stream)
         for units in range(50):
             print_progress(output, units)
@@ -66,7 +65,7 @@ class PkgConan(ConanFile):
         zipf.close()
 
         output_dir = os.path.join(tmp_dir, "output_dir")
-        new_out = StringIO()
+        new_out = six.StringIO()
         tools.unzip(zip_path, output_dir, output=ConanOutput(new_out))
 
         output = new_out.getvalue()
@@ -89,7 +88,7 @@ class PkgConan(ConanFile):
         zipf.close()
 
         output_dir = os.path.join(tmp_dir, "dst/"*40, "output_dir")
-        new_out = StringIO()
+        new_out = six.StringIO()
         tools.unzip(zip_path, output_dir, output=ConanOutput(new_out))
 
         output = new_out.getvalue()
diff --git a/conans/test/unittests/util/tools_test.py b/conans/test/unittests/util/tools_test.py
index db6c5ac61..b84b82ed3 100644
--- a/conans/test/unittests/util/tools_test.py
+++ b/conans/test/unittests/util/tools_test.py
@@ -6,6 +6,7 @@ import subprocess
 import sys
 import unittest
 import uuid
+import warnings
 from collections import namedtuple
 
 import mock
@@ -397,7 +398,7 @@ class SystemPackageToolTest(unittest.TestCase):
             return
         if platform.system() == "Windows" and not which("choco.exe"):
             return
-        spt = SystemPackageTool()
+        spt = SystemPackageTool(output=self.out)
         expected_package = "git"
         if platform.system() == "Windows" and which("choco.exe"):
             spt = SystemPackageTool(tool=ChocolateyTool(output=self.out), output=self.out)
@@ -486,6 +487,7 @@ class ReplaceInFileTest(unittest.TestCase):
 
 
 class ToolsTest(unittest.TestCase):
+    output = TestBufferConanOutput()
 
     def replace_paths_test(self):
         folder = temp_folder()
@@ -632,7 +634,7 @@ class HelloConan(ConanFile):
 
     def test_global_tools_overrided(self):
         client = TestClient()
- 
+
         conanfile = """
 from conans import ConanFile, tools
 
@@ -683,21 +685,39 @@ class HelloConan(ConanFile):
         settings.os = "Windows"
         settings.compiler = "Visual Studio"
         settings.compiler.version = "14"
+
         # test build_type and arch override, for multi-config packages
-        cmd = tools.msvc_build_command(settings, "project.sln", build_type="Debug", arch="x86")
+        with warnings.catch_warnings(record=True) as w:
+            warnings.simplefilter("always")
+            cmd = tools.msvc_build_command(settings, "project.sln", build_type="Debug",
+                                           arch="x86", output=self.output)
+            self.assertEqual(len(w), 2)
+            self.assertTrue(issubclass(w[0].category, DeprecationWarning))
         self.assertIn('msbuild "project.sln" /p:Configuration="Debug" /p:Platform="x86"', cmd)
         self.assertIn('vcvarsall.bat', cmd)
 
         # tests errors if args not defined
         with six.assertRaisesRegex(self, ConanException, "Cannot build_sln_command"):
-            tools.msvc_build_command(settings, "project.sln")
+            with warnings.catch_warnings(record=True) as w:
+                warnings.simplefilter("always")
+                tools.msvc_build_command(settings, "project.sln", output=self.output)
+                self.assertEqual(len(w), 2)
+                self.assertTrue(issubclass(w[0].category, DeprecationWarning))
         settings.arch = "x86"
         with six.assertRaisesRegex(self, ConanException, "Cannot build_sln_command"):
-            tools.msvc_build_command(settings, "project.sln")
+            with warnings.catch_warnings(record=True) as w:
+                warnings.simplefilter("always")
+                tools.msvc_build_command(settings, "project.sln", output=self.output)
+                self.assertEqual(len(w), 2)
+                self.assertTrue(issubclass(w[0].category, DeprecationWarning))
 
         # successful definition via settings
         settings.build_type = "Debug"
-        cmd = tools.msvc_build_command(settings, "project.sln")
+        with warnings.catch_warnings(record=True) as w:
+            warnings.simplefilter("always")
+            cmd = tools.msvc_build_command(settings, "project.sln", output=self.output)
+            self.assertEqual(len(w), 2)
+            self.assertTrue(issubclass(w[0].category, DeprecationWarning))
         self.assertIn('msbuild "project.sln" /p:Configuration="Debug" /p:Platform="x86"', cmd)
         self.assertIn('vcvarsall.bat', cmd)
 
@@ -773,7 +793,7 @@ class HelloConan(ConanFile):
         settings.os = "Windows"
         settings.compiler = "Visual Studio"
         settings.compiler.version = "14"
-        cmd = tools.vcvars_command(settings)
+        cmd = tools.vcvars_command(settings, output=self.output)
         output = TestBufferConanOutput()
         runner = TestRunner(output)
         runner(cmd + " && set vs140comntools")
@@ -782,7 +802,7 @@ class HelloConan(ConanFile):
         with tools.environment_append({"VisualStudioVersion": "14"}):
             output = TestBufferConanOutput()
             runner = TestRunner(output)
-            cmd = tools.vcvars_command(settings)
+            cmd = tools.vcvars_command(settings, output=self.output)
             runner(cmd + " && set vs140comntools")
             self.assertNotIn("vcvarsall.bat", str(output))
             self.assertIn("Conan:vcvars already set", str(output))
@@ -800,12 +820,12 @@ class HelloConan(ConanFile):
         settings.arch_build = "x86_64"
 
         # Set the env with a PATH containing the vcvars paths
-        tmp = tools.vcvars_dict(settings, only_diff=False)
+        tmp = tools.vcvars_dict(settings, only_diff=False, output=self.output)
         tmp = {key.lower(): value for key, value in tmp.items()}
         with tools.environment_append({"path": tmp["path"]}):
             previous_path = os.environ["PATH"].split(";")
             # Duplicate the path, inside the tools.vcvars shouldn't have repeated entries in PATH
-            with tools.vcvars(settings):
+            with tools.vcvars(settings, output=self.output):
                 path = os.environ["PATH"].split(";")
                 values_count = {value: path.count(value) for value in path}
                 for value, counter in values_count.items():
@@ -822,11 +842,13 @@ class HelloConan(ConanFile):
         settings.arch = "x86"
         settings.arch_build = "x86_64"
         with tools.environment_append({"PATH": ["custom_path", "WindowsFake"]}):
-            tmp = tools.vcvars_dict(settings, only_diff=False, filter_known_paths=True)
+            tmp = tools.vcvars_dict(settings, only_diff=False,
+                                    filter_known_paths=True, output=self.output)
             with tools.environment_append(tmp):
                 self.assertNotIn("custom_path", os.environ["PATH"])
                 self.assertIn("WindowsFake",  os.environ["PATH"])
-            tmp = tools.vcvars_dict(settings, only_diff=False, filter_known_paths=False)
+            tmp = tools.vcvars_dict(settings, only_diff=False,
+                                    filter_known_paths=False, output=self.output)
             with tools.environment_append(tmp):
                 self.assertIn("custom_path", os.environ["PATH"])
                 self.assertIn("WindowsFake", os.environ["PATH"])
@@ -840,12 +862,12 @@ class HelloConan(ConanFile):
         settings.compiler.version = "15"
         settings.arch = "x86"
         settings.arch_build = "x86_64"
-        cmd = tools.vcvars_command(settings)
+        cmd = tools.vcvars_command(settings, output=self.output)
         self.assertIn('vcvarsall.bat" amd64_x86', cmd)
 
         # It follows arch_build first
         settings.arch_build = "x86"
-        cmd = tools.vcvars_command(settings)
+        cmd = tools.vcvars_command(settings, output=self.output)
         self.assertIn('vcvarsall.bat" x86', cmd)
 
     def vcvars_raises_when_not_found_test(self):
@@ -930,22 +952,22 @@ compiler:
         settings.compiler = "Visual Studio"
         settings.compiler.version = "14"
         with tools.environment_append({"MYVAR": "1"}):
-            ret = vcvars_dict(settings, only_diff=False)
+            ret = vcvars_dict(settings, only_diff=False, output=self.output)
             self.assertIn("MYVAR", ret)
             self.assertIn("VCINSTALLDIR", ret)
 
-            ret = vcvars_dict(settings)
+            ret = vcvars_dict(settings, output=self.output)
             self.assertNotIn("MYVAR", ret)
             self.assertIn("VCINSTALLDIR", ret)
 
         my_lib_paths = "C:\\PATH\TO\MYLIBS;C:\\OTHER_LIBPATH"
         with tools.environment_append({"LIBPATH": my_lib_paths}):
-            ret = vcvars_dict(settings, only_diff=False)
+            ret = vcvars_dict(settings, only_diff=False, output=self.output)
             str_var_value = os.pathsep.join(ret["LIBPATH"])
             self.assertTrue(str_var_value.endswith(my_lib_paths))
 
             # Now only a diff, it should return the values as a list, but without the old values
-            ret = vcvars_dict(settings, only_diff=True)
+            ret = vcvars_dict(settings, only_diff=True, output=self.output)
             self.assertEqual(ret["LIBPATH"], str_var_value.split(os.pathsep)[0:-2])
 
             # But if we apply both environments, they are composed correctly
@@ -960,17 +982,17 @@ compiler:
 PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 158 Stepping 9, GenuineIntel
 
 
- PROCESSOR_LEVEL=6 
+ PROCESSOR_LEVEL=6
+
+PROCESSOR_REVISION=9e09
 
-PROCESSOR_REVISION=9e09    
 
-                         
 set nl=^
 env_var=
 without_equals_sign
 
 ProgramFiles(x86)=C:\Program Files (x86)
-       
+
 """.encode("utf-8")
 
         def vcvars_command_mock(settings, arch, compiler_version, force, vcvars_ver, winsdk_version,
@@ -983,7 +1005,7 @@ ProgramFiles(x86)=C:\Program Files (x86)
 
         with mock.patch('conans.client.tools.win.vcvars_command', new=vcvars_command_mock):
             with mock.patch('subprocess.check_output', new=subprocess_check_output_mock):
-                vcvars = tools.vcvars_dict(None, only_diff=False)
+                vcvars = tools.vcvars_dict(None, only_diff=False, output=self.output)
                 self.assertEqual(vcvars["PROCESSOR_ARCHITECTURE"], "AMD64")
                 self.assertEqual(vcvars["PROCESSOR_IDENTIFIER"], "Intel64 Family 6 Model 158 Stepping 9, GenuineIntel")
                 self.assertEqual(vcvars["PROCESSOR_LEVEL"], "6")
@@ -1168,15 +1190,15 @@ ProgramFiles(x86)=C:\Program Files (x86)
         build, host = get_values("Linux", "x86_64", "Linux", "armv8_32")
         self.assertEqual(build, "x86_64-linux-gnu")
         self.assertEqual(host, "aarch64-linux-gnu_ilp32")
-        
+
         build, host = get_values("Linux", "x86_64", "Linux", "armv5el")
         self.assertEqual(build, "x86_64-linux-gnu")
         self.assertEqual(host, "arm-linux-gnueabi")
-        
+
         build, host = get_values("Linux", "x86_64", "Linux", "armv5hf")
         self.assertEqual(build, "x86_64-linux-gnu")
         self.assertEqual(host, "arm-linux-gnueabihf")
-       
+
         build, host = get_values("Linux", "x86_64", "Android", "x86")
         self.assertEqual(build, "x86_64-linux-gnu")
         self.assertEqual(host, "i686-linux-android")
@@ -2268,7 +2290,7 @@ class CollectLibTestCase(unittest.TestCase):
         # Use cpp_info.libdirs
         conanfile.cpp_info.libdirs = ["lib", "custom_folder"]
         result = tools.collect_libs(conanfile)
-        self.assertEqual(["mylib", "customlib"], result)
+        self.assertEqual(["customlib", "mylib"], result)
 
         # Custom folder with multiple libdirs should only collect from custom folder
         self.assertEqual(["lib", "custom_folder"], conanfile.cpp_info.libdirs)
@@ -2334,7 +2356,7 @@ class CollectLibTestCase(unittest.TestCase):
         # Use cpp_info.libdirs
         conanfile.cpp_info.libdirs = ["lib", "custom_folder"]
         result = conanfile.collect_libs()
-        self.assertEqual(["mylib", "customlib"], result)
+        self.assertEqual(["customlib", "mylib"], result)
 
         # Custom folder with multiple libdirs should only collect from custom folder
         self.assertEqual(["lib", "custom_folder"], conanfile.cpp_info.libdirs)
diff --git a/conans/test/unittests/util/vcvars_arch_test.py b/conans/test/unittests/util/vcvars_arch_test.py
index 6e117c276..d1b995c69 100644
--- a/conans/test/unittests/util/vcvars_arch_test.py
+++ b/conans/test/unittests/util/vcvars_arch_test.py
@@ -11,14 +11,17 @@ from conans.client.conf import default_settings_yml
 from conans.client.tools.env import environment_append
 from conans.errors import ConanException
 from conans.model.settings import Settings
+from conans.test.utils.tools import TestBufferConanOutput
 
 
 @attr('visual_studio')
 @unittest.skipUnless(platform.system() == "Windows", "Requires Windows")
 class VCVarsArchTest(unittest.TestCase):
+    output = TestBufferConanOutput()
 
-    def assert_vcvars_command(self, settings, expected, **kwargs):
-        command = tools.vcvars_command(settings, **kwargs)
+    def assert_vcvars_command(self, settings, expected, output=None, **kwargs):
+        output = output or self.output
+        command = tools.vcvars_command(settings, output=output, **kwargs)
         command = command.replace('"', '').replace("'", "")
         self.assertTrue(command.endswith('vcvarsall.bat %s' % expected))
 
@@ -43,7 +46,7 @@ class VCVarsArchTest(unittest.TestCase):
 
         settings.arch = 'mips'
         with self.assertRaises(ConanException):
-            tools.vcvars_command(settings)
+            tools.vcvars_command(settings, output=self.output)
 
         settings.arch_build = 'x86_64'
         settings.arch = 'x86'
@@ -61,7 +64,7 @@ class VCVarsArchTest(unittest.TestCase):
         self.assert_vcvars_command(settings, "amd64_arm64", arch='armv8')
 
         with self.assertRaises(ConanException):
-            tools.vcvars_command(settings, arch='mips')
+            tools.vcvars_command(settings, arch='mips', output=self.output)
 
     def test_vcvars_ver_override(self):
         settings = Settings.loads(default_settings_yml)
@@ -69,13 +72,13 @@ class VCVarsArchTest(unittest.TestCase):
         settings.compiler.version = '15'
         settings.arch = 'x86_64'
 
-        command = tools.vcvars_command(settings, vcvars_ver='14.14')
+        command = tools.vcvars_command(settings, vcvars_ver='14.14', output=self.output)
         self.assertIn('vcvarsall.bat', command)
         self.assertIn('-vcvars_ver=14.14', command)
 
         settings.compiler.version = '14'
 
-        command = tools.vcvars_command(settings, vcvars_ver='14.14')
+        command = tools.vcvars_command(settings, vcvars_ver='14.14', output=self.output)
         self.assertIn('vcvarsall.bat', command)
         self.assertIn('-vcvars_ver=14.14', command)
 
@@ -85,12 +88,12 @@ class VCVarsArchTest(unittest.TestCase):
         settings.compiler.version = '15'
         settings.arch = 'x86_64'
 
-        command = tools.vcvars_command(settings, winsdk_version='8.1')
+        command = tools.vcvars_command(settings, winsdk_version='8.1', output=self.output)
         self.assertIn('vcvarsall.bat', command)
         self.assertIn('8.1', command)
 
         settings.compiler.version = '14'
 
-        command = tools.vcvars_command(settings, winsdk_version='8.1')
+        command = tools.vcvars_command(settings, winsdk_version='8.1', output=self.output)
         self.assertIn('vcvarsall.bat', command)
         self.assertIn('8.1', command)
diff --git a/conans/test/unittests/util/vcvars_clangcl_test.py b/conans/test/unittests/util/vcvars_clangcl_test.py
index 777af661a..5bcba5f6a 100644
--- a/conans/test/unittests/util/vcvars_clangcl_test.py
+++ b/conans/test/unittests/util/vcvars_clangcl_test.py
@@ -12,11 +12,13 @@ from conans.client.conf import default_settings_yml
 from conans.client.tools.win import vcvars_command
 from conans.errors import ConanException
 from conans.model.settings import Settings
+from conans.test.utils.tools import TestBufferConanOutput
 
 
 @attr('visual_studio')
 @unittest.skipUnless(platform.system() == "Windows", "Requires Windows")
 class VCVarsClangClTest(unittest.TestCase):
+    output = TestBufferConanOutput()
 
     def test_simple(self):
         settings = Settings.loads(default_settings_yml)
@@ -25,7 +27,7 @@ class VCVarsClangClTest(unittest.TestCase):
         settings.arch = 'x86'
         settings.os = 'Windows'
 
-        command = vcvars_command(settings)
+        command = vcvars_command(settings, output=self.output)
         self.assertIn('vcvarsall.bat', command)
         self.assertIn('x86', command)
 
@@ -35,7 +37,7 @@ class VCVarsClangClTest(unittest.TestCase):
         settings.arch = 'x86_64'
         settings.os = 'Windows'
 
-        command = vcvars_command(settings)
+        command = vcvars_command(settings, output=self.output)
         self.assertIn('vcvarsall.bat', command)
         self.assertIn('amd64', command)
 
@@ -48,4 +50,4 @@ class VCVarsClangClTest(unittest.TestCase):
         with mock.patch('conans.client.tools.win.latest_vs_version_installed',
                         mock.MagicMock(return_value=None)):
             with self.assertRaises(ConanException):
-                vcvars_command(settings)
+                vcvars_command(settings, output=self.output)
diff --git a/conans/test/unittests/util/vcvars_env_test.py b/conans/test/unittests/util/vcvars_env_test.py
index ca46c808d..f3ae8d301 100644
--- a/conans/test/unittests/util/vcvars_env_test.py
+++ b/conans/test/unittests/util/vcvars_env_test.py
@@ -5,6 +5,8 @@ from conans.test.utils.tools import TestClient
 from conans.util.files import save
 
 
+# TODO: This file does nothing!
+
 class VCVarsTest(unittest.TestCase):
 
     def basic(self):
diff --git a/conans/test/unittests/util/vcvars_store_test.py b/conans/test/unittests/util/vcvars_store_test.py
index 0cf366cba..4767bea90 100644
--- a/conans/test/unittests/util/vcvars_store_test.py
+++ b/conans/test/unittests/util/vcvars_store_test.py
@@ -10,10 +10,13 @@ from conans.client import tools
 from conans.client.conf import default_settings_yml
 from conans.errors import ConanException
 from conans.model.settings import Settings
+from conans.test.utils.tools import TestBufferConanOutput
 
 
 @attr('visual_studio')
 class VCVarsStoreTest(unittest.TestCase):
+    output = TestBufferConanOutput()
+
     def test_81(self):
         if platform.system() != "Windows":
             return
@@ -25,7 +28,7 @@ class VCVarsStoreTest(unittest.TestCase):
         settings.os = 'WindowsStore'
         settings.os.version = '8.1'
 
-        command = tools.vcvars_command(settings)
+        command = tools.vcvars_command(settings, output=self.output)
         self.assertIn('vcvarsall.bat', command)
         self.assertIn('x86', command)
         self.assertIn('store', command)
@@ -45,7 +48,7 @@ class VCVarsStoreTest(unittest.TestCase):
         settings.os = 'WindowsStore'
         settings.os.version = '10.0'
 
-        command = tools.vcvars_command(settings)
+        command = tools.vcvars_command(settings, output=self.output)
         self.assertIn('vcvarsall.bat', command)
         self.assertIn('x86', command)
         self.assertIn('store', command)
@@ -76,4 +79,4 @@ class VCVarsStoreTest(unittest.TestCase):
         settings.os.version = '666'
 
         with self.assertRaises(ConanException):
-            tools.vcvars_command(settings)
+            tools.vcvars_command(settings, output=self.output)
diff --git a/conans/test/unittests/util/xz_test.py b/conans/test/unittests/util/xz_test.py
index af59c5a34..02f9a8142 100644
--- a/conans/test/unittests/util/xz_test.py
+++ b/conans/test/unittests/util/xz_test.py
@@ -13,10 +13,12 @@ from conans.errors import ConanException
 from conans.model.ref import ConanFileReference, PackageReference
 from conans.test.utils.test_files import temp_folder
 from conans.test.utils.tools import NO_SETTINGS_PACKAGE_ID, TestClient, TestServer
+from conans.test.utils.tools import TestBufferConanOutput
 from conans.util.files import load, save_files
 
 
 class XZTest(TestCase):
+    output = TestBufferConanOutput()
 
     def test_error_xz(self):
         server = TestServer()
@@ -96,4 +98,4 @@ class Pkg(ConanFile):
     def test_error_python2(self):
         with six.assertRaisesRegex(self, ConanException, "XZ format not supported in Python 2"):
             dest_folder = temp_folder()
-            unzip("somefile.tar.xz", dest_folder)
+            unzip("somefile.tar.xz", dest_folder, output=self.output)
diff --git a/conans/test/unittests/util/zip_permissions_test.py b/conans/test/unittests/util/zip_permissions_test.py
index f7b0b1210..bbad806cb 100644
--- a/conans/test/unittests/util/zip_permissions_test.py
+++ b/conans/test/unittests/util/zip_permissions_test.py
@@ -36,4 +36,4 @@ class ZipPermissionsTest(TestCase):
                     if keep_permissions:
                         self.assertEqual(stat.S_IMODE(os.stat(dest_file).st_mode), perm_set)
                     else:
-                        self.assertNotEquals(stat.S_IMODE(os.stat(dest_file).st_mode), perm_set)
+                        self.assertNotEqual(stat.S_IMODE(os.stat(dest_file).st_mode), perm_set)