{"action":"created","issue":{"url":"https://api.github.com/repos/cpputest/cpputest/issues/460","labels_url":"https://api.github.com/repos/cpputest/cpputest/issues/460/labels{/name}","comments_url":"https://api.github.com/repos/cpputest/cpputest/issues/460/comments","events_url":"https://api.github.com/repos/cpputest/cpputest/issues/460/events","html_url":"https://github.com/cpputest/cpputest/issues/460","id":53028315,"number":460,"title":"Testing platform-specific code (-p on GCC in particular)","user":{"login":"arstrube","id":4686469,"avatar_url":"https://avatars.githubusercontent.com/u/4686469?v=3","gravatar_id":"","url":"https://api.github.com/users/arstrube","html_url":"https://github.com/arstrube","followers_url":"https://api.github.com/users/arstrube/followers","following_url":"https://api.github.com/users/arstrube/following{/other_user}","gists_url":"https://api.github.com/users/arstrube/gists{/gist_id}","starred_url":"https://api.github.com/users/arstrube/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arstrube/subscriptions","organizations_url":"https://api.github.com/users/arstrube/orgs","repos_url":"https://api.github.com/users/arstrube/repos","events_url":"https://api.github.com/users/arstrube/events{/privacy}","received_events_url":"https://api.github.com/users/arstrube/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2014-12-29T09:09:58Z","updated_at":"2015-02-03T04:48:22Z","closed_at":null,"body":"I have felt uneasy before about platform-specific code never receiving any direct testing.\r\n\r\nI am not sure that #ifdef'ing these tests into the main test executables is the way to go, either.\r\n\r\nI am about to add some more code (that needs tests) to the platform-specific run-in-separate process function. I propose to look at the testing issue in a wider context and to come up with a concept how platform-specific code can be tested.\r\n\r\nNaturally, we will focus on what can be tested with GCC and Travis-CI. It might make sense to create a separate test executable (so as to not unnecessarily bloat the Travis build). It might also make sense to put the tests into their respective platform-specific locations.\r\n\r\nContributors for other platforms could contribute tests to be run on those platforms only.\r\n\r\nWhat are your thoughts?"},"comment":{"url":"https://api.github.com/repos/cpputest/cpputest/issues/comments/72592375","html_url":"https://github.com/cpputest/cpputest/issues/460#issuecomment-72592375","issue_url":"https://api.github.com/repos/cpputest/cpputest/issues/460","id":72592375,"user":{"login":"Andne","id":3787585,"avatar_url":"https://avatars.githubusercontent.com/u/3787585?v=3","gravatar_id":"","url":"https://api.github.com/users/Andne","html_url":"https://github.com/Andne","followers_url":"https://api.github.com/users/Andne/followers","following_url":"https://api.github.com/users/Andne/following{/other_user}","gists_url":"https://api.github.com/users/Andne/gists{/gist_id}","starred_url":"https://api.github.com/users/Andne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Andne/subscriptions","organizations_url":"https://api.github.com/users/Andne/orgs","repos_url":"https://api.github.com/users/Andne/repos","events_url":"https://api.github.com/users/Andne/events{/privacy}","received_events_url":"https://api.github.com/users/Andne/received_events","type":"User","site_admin":false},"created_at":"2015-02-03T04:48:22Z","updated_at":"2015-02-03T04:48:22Z","body":"I played around with different builds of MinGW and haven't found a way to really detect which build someone has.  I think what I have found though is that it's technically not a matter of which toolchain is being used, it matters if the pthread library exists or not.\r\n\r\nOn Unix platforms, it seems to always exist, but there's a -pthread option that does something, though it seems to mostly be for the linker.\r\n\r\nWith the MinGW-w64 builds for windows, both posix and win32 thread builds have libpthread in them, so I think either one can use pthreads, the real difference is what the toolchain itself uses.  I saw a couple posts online that seemed to imply that this needs to agree with the library to avoid issues during exception handling, but other posts that disagreed with this.\r\n\r\nMy interpretation of all of this:\r\n1. All you need for pthreads is pthread.h and the library\r\n2. Mingw-builds of mingw-w64 (the versions that I tend to use) include pthread.h and the library\r\n3. So can we just assume that MinGW has pthreads and be done with it?  Maybe not due to older/other builds of MinGW likely not including libwinpthreads.  Otherwise, the only detection I can find is to see if pthread.h exists or not - maybe ok for autotools, not so sure about cmake.\r\n4. Wouldn't it be nice if there was a 'standard' implementation of MinGW?"}}