-
Notifications
You must be signed in to change notification settings - Fork 285
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
Split tutorials, examples, and tests into separate targets #644
Conversation
I like this change. One minor concern is the inconsistency of the name of |
@@ -1,7 +1,7 @@ | |||
make | |||
if [ $COVERALLS = ON ]; then make coveralls; fi | |||
sudo ldconfig --verbose # So the test executeables can detect libtinyxml2 | |||
if [ $BUILD_CORE_ONLY = OFF ]; then make test; fi | |||
if [ $BUILD_CORE_ONLY = OFF ]; then make all test tests; fi |
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.
question: I thought test
target is to run the tests that are already built. So the order of targets shouldn't be like make all tests test
? Moreover, I'm not sure why all
needs to be here. The above make
wouldn't run for all
target?
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.
You're right about the order: it should be make all test tests
. This was a typo.
All does need to be here. make
will invoke the first target in the Makefile
, which is typically all, if no goals are specified on the command line:
By default, the goal is the first target in the makefile (not counting targets that start with a period). Therefore, makefiles are usually written so that the first target is for compiling the entire program or programs they describe. If the first rule in the makefile has several targets, only the first target in the rule becomes the default goal, not the whole list. You can manage the selection of the default goal from within your makefile using the .DEFAULT_GOAL variable (see Other Special Variables). (Source)
Since we are specifying a goal on the command line, we need to manually pass all
. In practice, we may not need to do this because the tests
target may indirectly depend on all of the targets included in all
.
This raises another important question: should we also build tutorials
and examples
here, to verify that they build successfully?
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.
This raises another important question: should we also build tutorials and examples here, to verify that they build successfully?
I would prefer to do complete build test in travis unless it exceeds the build time limit.
I also like the name |
Looking at the Travis logs, it appears that I am not handling the |
👍 |
I fixed support for I updated the Travis build script. It seems to be working correctly, except for the We also need to update the Appveyor build to build the |
We can specify target if use cmake command to build like this. I'll make the change once this is merged.
I'll look into that on my Windows machine. |
This pull request replaces the
DART_BUILD_UNITTESTS
,DART_BUILD_EXAMPLES
andDART_BUILD_TUTORIALS
CMake flags thetests
,examples
, andtutorials
targets. These features are no longer built by default unless the user explicitly passes the corresponding target(s) tomake
.The key advantage of this approach is that targets are specified at build time, whereas CMake flags are specified at configure time. These features are optional and take a long time to build, so I prefer having them disabled by default. It's currently awkward to do this because changing these settings requires re-running CMake with new
-D
flags and, possibly, deleting yourCMakeCache.txt
file.With the new paradigm, this is as simple as running
make
during development and passing thetests
,examples
, ortutorials
target when you want to try re-building that code. Note that you can still runmake all tests examples tutorials
to build everything at once.I am not sure what @jslee02 and @mxgrey think of this change, so this pull request is mostly intended to start a discussion.