-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
conans/test/unittests/client/conf/detect/test_gcc_compiler.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import unittest | ||
|
||
import mock | ||
from parameterized import parameterized | ||
|
||
from conans.client.conf.detect import _gcc_compiler | ||
from conans.test.utils.tools import TestBufferConanOutput | ||
|
||
|
||
class GCCCompilerTestCase(unittest.TestCase): | ||
|
||
@parameterized.expand([("10",), ("4.2",), ('7', )]) | ||
def test_detect_gcc_10(self, version): | ||
output = TestBufferConanOutput() | ||
with mock.patch("platform.system", return_value="Linux"): | ||
with mock.patch("conans.client.conf.detect.detect_runner", return_value=(0, version)): | ||
compiler, installed_version = _gcc_compiler(output) | ||
self.assertEqual(compiler, 'gcc') | ||
self.assertEqual(installed_version, version) |