Skip to content
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

Merged
merged 1 commit into from Nov 19, 2020

Conversation

SSE4
Copy link
Contributor

@SSE4 SSE4 commented Nov 16, 2020

closes: #7812

Changelog: Feature: Tests for toolchains and Intel compiler.
Docs: omit

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the 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.

Copy link
Member

@memsharded memsharded left a 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.

conans/test/integration/toolchains/test_content.py Outdated Show resolved Hide resolved
conans/test/integration/toolchains/ios/test_using_cmake.py Outdated Show resolved Hide resolved
conans/test/integration/toolchains/intel/_base.py Outdated Show resolved Hide resolved
from conans.test.utils.tools import TestClient


class BaseIntelTestCase(unittest.TestCase):
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added pytest annotations

conans/test/integration/toolchains/intel/_base.py Outdated Show resolved Hide resolved
from conans.test.utils.tools import TestClient


class BaseIntelTestCase(unittest.TestCase):
Copy link
Member

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>
@@ -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':
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Contributor Author

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"
Copy link
Member

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

@memsharded memsharded merged commit e086e37 into conan-io:develop Nov 19, 2020
@memsharded memsharded added this to the 1.32 milestone Nov 19, 2020
if self.compiler == 'intel':
cvars = intel_compilervars_command(self._conanfile)
cmd = '%s && %s' % (cvars, cmd)
cmd += '/p:PlatformToolset="%s"' % msvs_toolset(self._conanfile)
Copy link
Member

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

Copy link
Contributor Author

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

Copy link
Member

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.

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #8078

@SSE4 SSE4 mentioned this pull request Nov 19, 2020
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] MSBuildToolchain + Intel compiler
2 participants