On 02/10/2010 11:13 AM, Elina Tjioe wrote: > I noticed that during the build time we are running not only unit tests > but also examples.
Indeed, since we need to test the examples to make sure they work.
> This causes problems with paths to input data files > and forces each example to use complicated logic to calculate paths.
True, particularly in Restrainer's case where you have paths embedded in your XML files - you can't use get_example_path() there.
> Would it be a good idea to > modify the build process to run examples from their respective > directories? This way all examples can use the relative paths and if a > user wishes to run an example, he/she can just cd to the example > directory and run it directly from there.
Yes, I agree - for running examples during the build, it should be straightforward enough to have the build system cd into build/doc/examples to run the example. That also ensures that any outputs generated by the example don't end up littering the source tree.
If a user wants to run an example manually, he/she can cd into the directory containing it.
Ben