-
Notifications
You must be signed in to change notification settings - Fork 53
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
Guideline on how to integrate this library? #15
Comments
You are right @paulreimer, there should be an easy integration with cmake. Thanks for the tips. I'll work on that. I'll keep this issue open as long as it won't be done. |
Personally, I created a I'm probably doing lots of things incorrectly (this is the simplest thing that worked). Using submodules makes it difficult to add I use it something like this (with
(And I followed the guide here to make sure the app was setup correctly to invoke my toolchain, build paths, etc) |
However if there was a library or executable approach that I could install (OS level, or just a one-time manual install), I would prefer that, probably, since it wouldn't need to compile as much during the test run. |
Googles recommended way to include Google Test: Applied to GUnit: New file CMakeLists.txt.in:
Existing build's CMakeLists.txt:
If you want to use gherkin, you can check if the library exists and if it is missing force a compilation during the cmake execution:
|
Thank you @MauganRa !
|
I can find lots of code examples on how to use it (in
example/
) but there are no build system files (CMakeLists.txt
) in those directories. Reading the top-levelCMakeLists.txt
, it sets up thetest( file SCENARIO=)
command, which seems like a good approach for the tests within this library:But more likely a typical app structure will be:
(at least having the GUnit repo as a submodule somewhere in the app, and our test cpp files out-of-tree) So how should we source those
test()
commands from the GUnitCMakeLists.txt
, or should we be copy/pasting them into our own files? Basically, what is your recommended way to use this in an existing project (and/or a new project, if that is different).Also... my CI is running on Raspberry Pi's and previously using Catch2 + Trompeloeil (which are header-only). So you can imagine the process is pretty simple, barely even needing a
Makefile
. Now that I have to compile 80+ files (mostly gherkin-c, if I want support for Gherkin), it really slows down the overall test process. How much of the deps of this library can be compiled into a library? I know Google.Test likes to be compiled alongside the actual test sources so it has the correct compiler flags, does this still apply to the latest Google.Test, to GUnit, or the other libs?If there was some way to replace all the GUnit submodules with a single library (at least to have that choice), that would be great. I'm not sure how the gherkin<->gtest integration works, but maybe some parts could be moved to an executable/runner?
The text was updated successfully, but these errors were encountered: