-
Notifications
You must be signed in to change notification settings - Fork 66
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
Add GTest example #17
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Do we talk about it in our docs? IMO every example here should have a reason: it is in our docs or it demonstrates some feature; otherwise CI times will grow and maintenance could be a problem |
I just rebased it now, let's see the result |
This example in the docs is about the |
I don't like the idea separating all examples again. Rarely are the users which know about hello repo. |
I totally agree that we shouldn't separate the examples, but for this one we need to run the actual And, I've just realized we have a bug in the example file, it says |
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
mac build failed but the error is not known to me |
I tried to reproduce on MacInCloud and did happen. I'll try one more test to validate. My guess is a runtime error related to dynamic library. |
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
This reverts commit 7ba41b6.
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: SSE4 <tomskside@gmail.com>
Signed-off-by: SSE4 <tomskside@gmail.com>
Signed-off-by: SSE4 <tomskside@gmail.com>
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.
I see. This is moving the sourcces from https://github.com/lasote/conan-gtest-example to this repo :+1
Nevertheless I think we should run the same commands in the appveyor.yml
file provided in the docs and here. I don't know if the intention is to change the lines in the appveyor.yml
file too.
About the Mac error. Really worried about it. Does it mean we are not detecting the apple-clang
version properly? I see compiler.version=10.0
in the output, but the version in 10.13
.
From Conan sources:
def _clang_compiler(output, compiler_exe="clang"):
try:
ret, out = detect_runner('%s --version' % compiler_exe)
if ret != 0:
return None
if "Apple" in out:
compiler = "apple-clang"
elif "clang version" in out:
compiler = "clang"
installed_version = re.search("([0-9]+\.[0-9])", out).group()
if installed_version:
output.success("Found %s %s" % (compiler, installed_version))
return compiler, installed_version
except Exception:
return None
and the regex will catch only the first figure of the minor version of the compiler 😱 I'll double-check it and open issue/PR in Conan if needed.
The problem is not detecting the compiler, according to this list here (https://en.wikipedia.org/wiki/Xcode#Xcode_7.0_-_11.x_(since_Free_On-Device_Development)) there is no apple-clang |
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.
MacOS is failing because of the shared
, it cannot find dylib. Check the full output here:
----Running------
> cmake --build '/Users/jgsogo/dev/conan/examples/libraries/gtest/encryption/test_package/build/8b8e3c6c4c013ae5cdfb03a30f473e07a61b45b2' '--target' 'test' '--' '-j12'
-----------------
Running tests...
Test project /Users/jgsogo/dev/conan/examples/libraries/gtest/encryption/test_package/build/8b8e3c6c4c013ae5cdfb03a30f473e07a61b45b2
Start 1: encryption
1/1 Test #1: encryption .......................Child aborted***Exception: 0.11 sec
dyld: Library not loaded: libgmock_maind.dylib
Referenced from: /Users/jgsogo/dev/conan/examples/libraries/gtest/encryption/test_package/build/8b8e3c6c4c013ae5cdfb03a30f473e07a61b45b2/bin/encryption-test
Reason: image not found
0% tests passed, 1 tests failed out of 1
Total Test time (real) = 0.11 sec
The following tests FAILED:
1 - encryption (Child aborted)
Errors while running CTest
make: *** [test] Error 8
This is something to investigate, probably related to the issue that the DYLD_LIBRARY...
should be set in the same call as the command itself, and cmake.test
is not doing that.
Quick solution: use gtest
static
Just as a reference, I've been trying the example locally and using
|
Did you manage to fix this issue? We can try to finish this PR |
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Hello, I'm interested by a conan 2.0 example project using some tests written with GTest outside of test_package as described in "A different approach " of https://github.com/lasote/conan-gtest-example#synopsis. Regards. |
@EstebanDugueperoux2 you want to refer to the examples repo for Conan 2.0: https://github.com/conan-io/examples2 |
Yes, I'll try to submit a little example through a pull request showing my issue. Regards. |
Yes, that link is broken for 2.0 docs, we would need to fix it |
An user from Stack Overflow is following https://github.com/lasote/conan-gtest-example. Since it's an example, I've moved it to here.
New documentation for GTest: conan-io/docs#1668