New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: tests for toolchains and intel compiler #8062
Conversation
4736478
to
9bdce78
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is good, please read the comments.
from conans.test.utils.tools import TestClient | ||
|
||
|
||
class BaseIntelTestCase(unittest.TestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the new pytest.mark
annotations for tests and use them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are they documented somewhere? e.g. what does @pytest.mark.tool_compiler
mean - does it mean working compiler is required to run test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not documented yet, pretty new, just have a look to the other tests.
Yes, you should use @pytest.mark.tool_icc
for example for intel, and if using CMake, or MSBuild, use @pytest.mark.tool_cmake
too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added pytest annotations
9bdce78
to
b563bfa
Compare
from conans.test.utils.tools import TestClient | ||
|
||
|
||
class BaseIntelTestCase(unittest.TestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not documented yet, pretty new, just have a look to the other tests.
Yes, you should use @pytest.mark.tool_icc
for example for intel, and if using CMake, or MSBuild, use @pytest.mark.tool_cmake
too.
Signed-off-by: SSE4 <tomskside@gmail.com>
b563bfa
to
c8d9e75
Compare
@@ -32,14 +34,20 @@ def command(self, sln): | |||
vcvars_ver=None) | |||
cmd = ('%s && msbuild "%s" /p:Configuration=%s /p:Platform=%s ' | |||
% (vcvars, sln, self.build_type, self.platform)) | |||
|
|||
if self.compiler == 'intel': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From some parts of the docs (https://software.intel.com/content/www/us/en/develop/documentation/get-started-with-cpp-compiler-for-windows/top.html), it could seem that the intel_compilervars already include setting up the Visual environment too, and then, calling vcvars explicitly would not be needed? I guess you have already checked, but just in case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it works, I'll change code a bit to avoid redundant vcvars
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, too late :) never mind then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see #8078
@@ -50,6 +58,8 @@ def __init__(self, conanfile): | |||
self._conanfile = conanfile | |||
self.preprocessor_definitions = {} | |||
|
|||
filename = "conan_toolchain.props" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has changed in develop already, doesn't conflict because the definition is above. I will solve the conflict after merge
if self.compiler == 'intel': | ||
cvars = intel_compilervars_command(self._conanfile) | ||
cmd = '%s && %s' % (cvars, cmd) | ||
cmd += '/p:PlatformToolset="%s"' % msvs_toolset(self._conanfile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this line really necessary if the toolset is defined in the toolchain file? It was one of the goals of the toolchain, to simplify the command line invocation by capturing some of it in the toolchain files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for me, it doesn't work without this line. probably, it's too late in toolchain file to override this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works well for other toolsets, that behavior is tested, in the MSBuildToolchain tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it was before I moved the import of the toolchain to the correct place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, checked one more time and it works! sorry for the confusion, I'll create a follow up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see #8078
closes: #7812
Changelog: Feature: Tests for toolchains and Intel compiler.
Docs: omit
develop
branch, documenting this one.Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.