You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Questions which need to be answered in order to implement this:
how to set include directories and flags for tests and examples
should one be able / how to switch between one test per source file and one executable for all the sources
what should be the build folder structure
can / should include directories and flags be set per example
can / should we enable more complex examples, where additional sources are compiled into an example
should there be a command build tests, e.g. clang-build tests and/or to run tests, e.g. clang-build runtests
should the test and example executables appear in the dependency graph, or should separate dependency graphs be created for them?
My suggestions for what we should encourage:
tests should be inside a tests folder and examples in an examples folder
sources inside the tests folder should be compiled into a single executable
sources in the examples folder should be compiled into one example each
Example config:
[mylib]
target_type = "static library"sources = ["src/*.cpp"]
[mylib.tests]
sources = ["tests/*.cpp"]
[mylib.examples]
include_directories = ["deps"]
sources = ["examples/*.cpp", "deps/something.cpp"] # does something like this make sense?
[mylib.examples.flags]
compile = ["-Wno-unused-parameter"]
Tests in the boost libraries are messier than I expected... They have a lot of files which are meant to not compile and therefore have to be excluded form the test builds. Also, some tests require additional flags, which the library does not.
I'm not sure yet, but it seems some tests also have additional dependencies on other boost libraries...
Therefore, a tests section in the target config seems necessary to me. It should at least contain sources or sources exclude patterns and flags.
The text was updated successfully, but these errors were encountered:
When PR #108 is merged, a revised and improved implementation of this feature can be made and PR #102 closed. Due to the improved dependency resolution process, tests and examples will be able to automatically notice when a dependency is missing.
There still remains the question how to represent tests and examples in the dependency graph:
use Tests and Examples classes, derived from Target, which potentially have several output files?
create Executable targets for each test and example?
Note, in both cases, corresponding TargetDescriptions will be necessary.
Depends on #64.
Questions which need to be answered in order to implement this:
clang-build tests
and/or to run tests, e.g.clang-build runtests
My suggestions for what we should encourage:
tests
folder and examples in anexamples
folderExample config:
Tests in the boost libraries are messier than I expected... They have a lot of files which are meant to not compile and therefore have to be excluded form the test builds. Also, some tests require additional flags, which the library does not.
I'm not sure yet, but it seems some tests also have additional dependencies on other boost libraries...
Therefore, a
tests
section in the target config seems necessary to me. It should at least contain sources or sources exclude patterns and flags.The text was updated successfully, but these errors were encountered: