{"action":"created","comment":{"url":"https://api.github.com/repos/conan-io/conan/pulls/comments/169696699","pull_request_review_id":98264992,"id":169696699,"diff_hunk":"@@ -1,15 +1,60 @@\n+import platform\n import unittest\n-from conans.test.utils.tools import TestBufferConanOutput\n+from subprocess import Popen, PIPE, STDOUT\n+\n+from conans import tools\n from conans.client.conf.detect import detect_defaults_settings\n-import platform\n+from conans.test.utils.tools import TestBufferConanOutput\n \n \n class DetectTest(unittest.TestCase):\n \n-    def detect_test(self):\n+    def detect_default_compilers_test(self):\n+        platform_default_compilers = {\n+            \"Linux\": \"gcc\",\n+            \"Darwin\": \"apple-clang\",\n+            \"Windows\": \"Visual Studio\"\n+        }\n         output = TestBufferConanOutput()\n         result = detect_defaults_settings(output)\n-        if platform.system() == \"Linux\":\n-            for (name, value) in result:\n-                if name == \"compiler\":\n-                    self.assertEquals(value, \"gcc\")\n+        # result is a list of tuples (name, value) so converting it to dict\n+        result = dict(result)\n+        platform_compiler = platform_default_compilers.get(platform.system(), None)\n+        if platform_compiler is not None:\n+            self.assertEquals(result.get(\"compiler\", None), platform_compiler)\n+\n+    def detect_default_in_mac_os_using_gcc_as_default_test(self):\n+        \"\"\"\n+        Test if gcc in Mac OS X is using apple-clang as frontend\n+        \"\"\"\n+        # See: https://github.com/conan-io/conan/issues/2231\n+        if platform.system() != \"Darwin\":\n+            return\n+\n+        def _execute(command):","path":"conans/test/util/detect_test.py","position":41,"original_position":41,"commit_id":"a8c1e6d68a283fe01d171540c3e9845c200d94cd","original_commit_id":"a8c1e6d68a283fe01d171540c3e9845c200d94cd","user":{"login":"lasote","id":3807515,"avatar_url":"https://avatars1.githubusercontent.com/u/3807515?v=4","gravatar_id":"","url":"https://api.github.com/users/lasote","html_url":"https://github.com/lasote","followers_url":"https://api.github.com/users/lasote/followers","following_url":"https://api.github.com/users/lasote/following{/other_user}","gists_url":"https://api.github.com/users/lasote/gists{/gist_id}","starred_url":"https://api.github.com/users/lasote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lasote/subscriptions","organizations_url":"https://api.github.com/users/lasote/orgs","repos_url":"https://api.github.com/users/lasote/repos","events_url":"https://api.github.com/users/lasote/events{/privacy}","received_events_url":"https://api.github.com/users/lasote/received_events","type":"User","site_admin":false},"body":"You can simplify all this with `output_str = subprocess.check_output(command)` and try, except in case of subprocess failure.","created_at":"2018-02-21T16:30:56Z","updated_at":"2018-02-21T16:33:00Z","html_url":"https://github.com/conan-io/conan/pull/2487#discussion_r169696699","pull_request_url":"https://api.github.com/repos/conan-io/conan/pulls/2487","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/conan-io/conan/pulls/comments/169696699"},"html":{"href":"https://github.com/conan-io/conan/pull/2487#discussion_r169696699"},"pull_request":{"href":"https://api.github.com/repos/conan-io/conan/pulls/2487"}}},"pull_request":{"url":"https://api.github.com/repos/conan-io/conan/pulls/2487","id":169711223,"html_url":"https://github.com/conan-io/conan/pull/2487","diff_url":"https://github.com/conan-io/conan/pull/2487.diff","patch_url":"https://github.com/conan-io/conan/pull/2487.patch","issue_url":"https://api.github.com/repos/conan-io/conan/issues/2487","number":2487,"state":"open","locked":false,"title":"2231 conan compiler detection","user":{"login":"pvicente","id":471109,"avatar_url":"https://avatars3.githubusercontent.com/u/471109?v=4","gravatar_id":"","url":"https://api.github.com/users/pvicente","html_url":"https://github.com/pvicente","followers_url":"https://api.github.com/users/pvicente/followers","following_url":"https://api.github.com/users/pvicente/following{/other_user}","gists_url":"https://api.github.com/users/pvicente/gists{/gist_id}","starred_url":"https://api.github.com/users/pvicente/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pvicente/subscriptions","organizations_url":"https://api.github.com/users/pvicente/orgs","repos_url":"https://api.github.com/users/pvicente/repos","events_url":"https://api.github.com/users/pvicente/events{/privacy}","received_events_url":"https://api.github.com/users/pvicente/received_events","type":"User","site_admin":false},"body":"- [X] Refer to the issue that supports this Pull Request.\r\n- [X] I've read the [Contributing guide](https://raw.githubusercontent.com/conan-io/conan/develop/.github/CONTRIBUTING.md).\r\n- [X] I've followed the PEP8 style guides for Python code.\r\n\r\ncloses #2231 \r\n\r\nPreviously failing compiler detection in mac os x when gcc was forced:\r\n\r\n```bash\r\n09:28 $ CC=gcc CXX=g++ conan install boost/1.66.0@conan/stable\r\nAuto detecting your dev setup to initialize the default profile (/Users/pvicente/.conan/profiles/default)\r\nCC and CXX: gcc, g++\r\nFound gcc 4.2\r\nDefault settings\r\n\tos=Macos\r\n\tos_build=Macos\r\n\tarch=x86_64\r\n\tarch_build=x86_64\r\n\tcompiler=gcc\r\n\tcompiler.version=4.2\r\n\tcompiler.libcxx=libstdc++\r\n\tbuild_type=Release\r\n*** You can change them in /Users/pvicente/.conan/profiles/default ***\r\n*** Or override with -s compiler='other' -s ...s***\r\n\r\n\r\nERROR: Invalid setting '4.2' is not a valid 'settings.compiler.version' value.\r\nPossible values are ['4.1', '4.4', '4.5', '4.6', '4.7', '4.8', '4.9', '5', '5.1', '5.2', '5.3', '5.4', '5.5', '6', '6.1', '6.2', '6.3', '6.4', '7', '7.1', '7.2', '7.3']\r\nRead \"http://docs.conan.io/en/latest/faq/troubleshooting.html#error-invalid-setting\"\r\n```\r\n\r\nNow:\r\n\r\n```bash\r\n09:26 $ CC=gcc CXX=g++ conan install boost/1.66.0@conan/stable\r\nAuto detecting your dev setup to initialize the default profile (/Users/pvicente/.conan/profiles/default)\r\nCC and CXX: gcc, g++\r\nFound apple-clang 9.0\r\nDefault settings\r\n\tos=Macos\r\n\tos_build=Macos\r\n\tarch=x86_64\r\n\tarch_build=x86_64\r\n\tcompiler=apple-clang\r\n\tcompiler.version=9.0\r\n\tcompiler.libcxx=libc++\r\n\tbuild_type=Release\r\n*** You can change them in /Users/pvicente/.conan/profiles/default ***\r\n*** Or override with -s compiler='other' -s ...s***\r\n...\r\n```\r\n","created_at":"2018-02-16T19:52:30Z","updated_at":"2018-02-21T16:33:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"102402a86fc65d8d1fafb1dc3d57bbf9f35601f6","assignee":{"login":"pvicente","id":471109,"avatar_url":"https://avatars3.githubusercontent.com/u/471109?v=4","gravatar_id":"","url":"https://api.github.com/users/pvicente","html_url":"https://github.com/pvicente","followers_url":"https://api.github.com/users/pvicente/followers","following_url":"https://api.github.com/users/pvicente/following{/other_user}","gists_url":"https://api.github.com/users/pvicente/gists{/gist_id}","starred_url":"https://api.github.com/users/pvicente/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pvicente/subscriptions","organizations_url":"https://api.github.com/users/pvicente/orgs","repos_url":"https://api.github.com/users/pvicente/repos","events_url":"https://api.github.com/users/pvicente/events{/privacy}","received_events_url":"https://api.github.com/users/pvicente/received_events","type":"User","site_admin":false},"assignees":[{"login":"pvicente","id":471109,"avatar_url":"https://avatars3.githubusercontent.com/u/471109?v=4","gravatar_id":"","url":"https://api.github.com/users/pvicente","html_url":"https://github.com/pvicente","followers_url":"https://api.github.com/users/pvicente/followers","following_url":"https://api.github.com/users/pvicente/following{/other_user}","gists_url":"https://api.github.com/users/pvicente/gists{/gist_id}","starred_url":"https://api.github.com/users/pvicente/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pvicente/subscriptions","organizations_url":"https://api.github.com/users/pvicente/orgs","repos_url":"https://api.github.com/users/pvicente/repos","events_url":"https://api.github.com/users/pvicente/events{/privacy}","received_events_url":"https://api.github.com/users/pvicente/received_events","type":"User","site_admin":false},{"login":"memsharded","id":15367152,"avatar_url":"https://avatars2.githubusercontent.com/u/15367152?v=4","gravatar_id":"","url":"https://api.github.com/users/memsharded","html_url":"https://github.com/memsharded","followers_url":"https://api.github.com/users/memsharded/followers","following_url":"https://api.github.com/users/memsharded/following{/other_user}","gists_url":"https://api.github.com/users/memsharded/gists{/gist_id}","starred_url":"https://api.github.com/users/memsharded/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/memsharded/subscriptions","organizations_url":"https://api.github.com/users/memsharded/orgs","repos_url":"https://api.github.com/users/memsharded/repos","events_url":"https://api.github.com/users/memsharded/events{/privacy}","received_events_url":"https://api.github.com/users/memsharded/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":821746717,"url":"https://api.github.com/repos/conan-io/conan/labels/in%20review","name":"in review","color":"0000e6","default":false}],"milestone":{"url":"https://api.github.com/repos/conan-io/conan/milestones/35","html_url":"https://github.com/conan-io/conan/milestone/35","labels_url":"https://api.github.com/repos/conan-io/conan/milestones/35/labels","id":2991467,"number":35,"title":"1.1","description":"","creator":{"login":"lasote","id":3807515,"avatar_url":"https://avatars1.githubusercontent.com/u/3807515?v=4","gravatar_id":"","url":"https://api.github.com/users/lasote","html_url":"https://github.com/lasote","followers_url":"https://api.github.com/users/lasote/followers","following_url":"https://api.github.com/users/lasote/following{/other_user}","gists_url":"https://api.github.com/users/lasote/gists{/gist_id}","starred_url":"https://api.github.com/users/lasote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lasote/subscriptions","organizations_url":"https://api.github.com/users/lasote/orgs","repos_url":"https://api.github.com/users/lasote/repos","events_url":"https://api.github.com/users/lasote/events{/privacy}","received_events_url":"https://api.github.com/users/lasote/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":90,"state":"open","created_at":"2017-12-20T17:22:53Z","updated_at":"2018-02-21T16:23:14Z","due_on":"2018-02-27T08:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/conan-io/conan/pulls/2487/commits","review_comments_url":"https://api.github.com/repos/conan-io/conan/pulls/2487/comments","review_comment_url":"https://api.github.com/repos/conan-io/conan/pulls/comments{/number}","comments_url":"https://api.github.com/repos/conan-io/conan/issues/2487/comments","statuses_url":"https://api.github.com/repos/conan-io/conan/statuses/a8c1e6d68a283fe01d171540c3e9845c200d94cd","head":{"label":"pvicente:2231_conan_compiler_detection","ref":"2231_conan_compiler_detection","sha":"a8c1e6d68a283fe01d171540c3e9845c200d94cd","user":{"login":"pvicente","id":471109,"avatar_url":"https://avatars3.githubusercontent.com/u/471109?v=4","gravatar_id":"","url":"https://api.github.com/users/pvicente","html_url":"https://github.com/pvicente","followers_url":"https://api.github.com/users/pvicente/followers","following_url":"https://api.github.com/users/pvicente/following{/other_user}","gists_url":"https://api.github.com/users/pvicente/gists{/gist_id}","starred_url":"https://api.github.com/users/pvicente/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pvicente/subscriptions","organizations_url":"https://api.github.com/users/pvicente/orgs","repos_url":"https://api.github.com/users/pvicente/repos","events_url":"https://api.github.com/users/pvicente/events{/privacy}","received_events_url":"https://api.github.com/users/pvicente/received_events","type":"User","site_admin":false},"repo":{"id":118588330,"name":"conan","full_name":"pvicente/conan","owner":{"login":"pvicente","id":471109,"avatar_url":"https://avatars3.githubusercontent.com/u/471109?v=4","gravatar_id":"","url":"https://api.github.com/users/pvicente","html_url":"https://github.com/pvicente","followers_url":"https://api.github.com/users/pvicente/followers","following_url":"https://api.github.com/users/pvicente/following{/other_user}","gists_url":"https://api.github.com/users/pvicente/gists{/gist_id}","starred_url":"https://api.github.com/users/pvicente/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pvicente/subscriptions","organizations_url":"https://api.github.com/users/pvicente/orgs","repos_url":"https://api.github.com/users/pvicente/repos","events_url":"https://api.github.com/users/pvicente/events{/privacy}","received_events_url":"https://api.github.com/users/pvicente/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pvicente/conan","description":"Conan.io - The open-source C/C++ package manager","fork":true,"url":"https://api.github.com/repos/pvicente/conan","forks_url":"https://api.github.com/repos/pvicente/conan/forks","keys_url":"https://api.github.com/repos/pvicente/conan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pvicente/conan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pvicente/conan/teams","hooks_url":"https://api.github.com/repos/pvicente/conan/hooks","issue_events_url":"https://api.github.com/repos/pvicente/conan/issues/events{/number}","events_url":"https://api.github.com/repos/pvicente/conan/events","assignees_url":"https://api.github.com/repos/pvicente/conan/assignees{/user}","branches_url":"https://api.github.com/repos/pvicente/conan/branches{/branch}","tags_url":"https://api.github.com/repos/pvicente/conan/tags","blobs_url":"https://api.github.com/repos/pvicente/conan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pvicente/conan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pvicente/conan/git/refs{/sha}","trees_url":"https://api.github.com/repos/pvicente/conan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pvicente/conan/statuses/{sha}","languages_url":"https://api.github.com/repos/pvicente/conan/languages","stargazers_url":"https://api.github.com/repos/pvicente/conan/stargazers","contributors_url":"https://api.github.com/repos/pvicente/conan/contributors","subscribers_url":"https://api.github.com/repos/pvicente/conan/subscribers","subscription_url":"https://api.github.com/repos/pvicente/conan/subscription","commits_url":"https://api.github.com/repos/pvicente/conan/commits{/sha}","git_commits_url":"https://api.github.com/repos/pvicente/conan/git/commits{/sha}","comments_url":"https://api.github.com/repos/pvicente/conan/comments{/number}","issue_comment_url":"https://api.github.com/repos/pvicente/conan/issues/comments{/number}","contents_url":"https://api.github.com/repos/pvicente/conan/contents/{+path}","compare_url":"https://api.github.com/repos/pvicente/conan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pvicente/conan/merges","archive_url":"https://api.github.com/repos/pvicente/conan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pvicente/conan/downloads","issues_url":"https://api.github.com/repos/pvicente/conan/issues{/number}","pulls_url":"https://api.github.com/repos/pvicente/conan/pulls{/number}","milestones_url":"https://api.github.com/repos/pvicente/conan/milestones{/number}","notifications_url":"https://api.github.com/repos/pvicente/conan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pvicente/conan/labels{/name}","releases_url":"https://api.github.com/repos/pvicente/conan/releases{/id}","deployments_url":"https://api.github.com/repos/pvicente/conan/deployments","created_at":"2018-01-23T09:31:19Z","updated_at":"2018-01-23T09:31:22Z","pushed_at":"2018-02-21T13:59:29Z","git_url":"git://github.com/pvicente/conan.git","ssh_url":"git@github.com:pvicente/conan.git","clone_url":"https://github.com/pvicente/conan.git","svn_url":"https://github.com/pvicente/conan","homepage":"https://conan.io","size":4252,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"conan-io:develop","ref":"develop","sha":"53381b9e6fc623a49f996506f2038caf3cf52709","user":{"login":"conan-io","id":15212165,"avatar_url":"https://avatars3.githubusercontent.com/u/15212165?v=4","gravatar_id":"","url":"https://api.github.com/users/conan-io","html_url":"https://github.com/conan-io","followers_url":"https://api.github.com/users/conan-io/followers","following_url":"https://api.github.com/users/conan-io/following{/other_user}","gists_url":"https://api.github.com/users/conan-io/gists{/gist_id}","starred_url":"https://api.github.com/users/conan-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conan-io/subscriptions","organizations_url":"https://api.github.com/users/conan-io/orgs","repos_url":"https://api.github.com/users/conan-io/repos","events_url":"https://api.github.com/users/conan-io/events{/privacy}","received_events_url":"https://api.github.com/users/conan-io/received_events","type":"Organization","site_admin":false},"repo":{"id":47190624,"name":"conan","full_name":"conan-io/conan","owner":{"login":"conan-io","id":15212165,"avatar_url":"https://avatars3.githubusercontent.com/u/15212165?v=4","gravatar_id":"","url":"https://api.github.com/users/conan-io","html_url":"https://github.com/conan-io","followers_url":"https://api.github.com/users/conan-io/followers","following_url":"https://api.github.com/users/conan-io/following{/other_user}","gists_url":"https://api.github.com/users/conan-io/gists{/gist_id}","starred_url":"https://api.github.com/users/conan-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conan-io/subscriptions","organizations_url":"https://api.github.com/users/conan-io/orgs","repos_url":"https://api.github.com/users/conan-io/repos","events_url":"https://api.github.com/users/conan-io/events{/privacy}","received_events_url":"https://api.github.com/users/conan-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/conan-io/conan","description":"Conan.io - The open-source C/C++ package manager","fork":false,"url":"https://api.github.com/repos/conan-io/conan","forks_url":"https://api.github.com/repos/conan-io/conan/forks","keys_url":"https://api.github.com/repos/conan-io/conan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/conan-io/conan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/conan-io/conan/teams","hooks_url":"https://api.github.com/repos/conan-io/conan/hooks","issue_events_url":"https://api.github.com/repos/conan-io/conan/issues/events{/number}","events_url":"https://api.github.com/repos/conan-io/conan/events","assignees_url":"https://api.github.com/repos/conan-io/conan/assignees{/user}","branches_url":"https://api.github.com/repos/conan-io/conan/branches{/branch}","tags_url":"https://api.github.com/repos/conan-io/conan/tags","blobs_url":"https://api.github.com/repos/conan-io/conan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/conan-io/conan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/conan-io/conan/git/refs{/sha}","trees_url":"https://api.github.com/repos/conan-io/conan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/conan-io/conan/statuses/{sha}","languages_url":"https://api.github.com/repos/conan-io/conan/languages","stargazers_url":"https://api.github.com/repos/conan-io/conan/stargazers","contributors_url":"https://api.github.com/repos/conan-io/conan/contributors","subscribers_url":"https://api.github.com/repos/conan-io/conan/subscribers","subscription_url":"https://api.github.com/repos/conan-io/conan/subscription","commits_url":"https://api.github.com/repos/conan-io/conan/commits{/sha}","git_commits_url":"https://api.github.com/repos/conan-io/conan/git/commits{/sha}","comments_url":"https://api.github.com/repos/conan-io/conan/comments{/number}","issue_comment_url":"https://api.github.com/repos/conan-io/conan/issues/comments{/number}","contents_url":"https://api.github.com/repos/conan-io/conan/contents/{+path}","compare_url":"https://api.github.com/repos/conan-io/conan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/conan-io/conan/merges","archive_url":"https://api.github.com/repos/conan-io/conan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/conan-io/conan/downloads","issues_url":"https://api.github.com/repos/conan-io/conan/issues{/number}","pulls_url":"https://api.github.com/repos/conan-io/conan/pulls{/number}","milestones_url":"https://api.github.com/repos/conan-io/conan/milestones{/number}","notifications_url":"https://api.github.com/repos/conan-io/conan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/conan-io/conan/labels{/name}","releases_url":"https://api.github.com/repos/conan-io/conan/releases{/id}","deployments_url":"https://api.github.com/repos/conan-io/conan/deployments","created_at":"2015-12-01T13:17:02Z","updated_at":"2018-02-21T15:33:22Z","pushed_at":"2018-02-21T16:23:14Z","git_url":"git://github.com/conan-io/conan.git","ssh_url":"git@github.com:conan-io/conan.git","clone_url":"https://github.com/conan-io/conan.git","svn_url":"https://github.com/conan-io/conan","homepage":"https://conan.io","size":4011,"stargazers_count":1537,"watchers_count":1537,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":204,"mirror_url":null,"archived":false,"open_issues_count":305,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":204,"open_issues":305,"watchers":1537,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/conan-io/conan/pulls/2487"},"html":{"href":"https://github.com/conan-io/conan/pull/2487"},"issue":{"href":"https://api.github.com/repos/conan-io/conan/issues/2487"},"comments":{"href":"https://api.github.com/repos/conan-io/conan/issues/2487/comments"},"review_comments":{"href":"https://api.github.com/repos/conan-io/conan/pulls/2487/comments"},"review_comment":{"href":"https://api.github.com/repos/conan-io/conan/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/conan-io/conan/pulls/2487/commits"},"statuses":{"href":"https://api.github.com/repos/conan-io/conan/statuses/a8c1e6d68a283fe01d171540c3e9845c200d94cd"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"lasote"}}