Help requested building and running tests

I apologize in advance. I can not figure out how to get tests to build and run correctly from within subdirectories. The --builddir option does not seem to be honored, and the Jamfiles are so "simple" that I haven't a clue as to what is happening. To be honest, I have made several attempts at using bjam, but the only thing I can get to work is a toplevel make of everything. So, for all my own stuff, I have been using a mirror hierarchy and Makefiles (since that is what I have been using for the last 2 decades). However, I now want to get some code ready for submission (I have moved type_id and in the process have written a dynamic library wrapper as well). Unfortunately, I can not get my tests to integrate very well within boost. Thus, I humbly ask for any pointers and/or assistance in this regard. Thanks!

Jody Hagins wrote:
I apologize in advance. I can not figure out how to get tests to build and run correctly from within subdirectories.
I'm definitely no bjam expert, but maybe I can help because I had recently had to delve into building and testing myself.
The --builddir option does not seem to be honored, and the Jamfiles are so "simple" that I haven't a clue as to what is happening.
One example of how to run tests would be the following (this assumes MSVC7.1): 1. Make sure bjam is in your PATH 2. Open a command prompt 3. Change the current directory to libs\optional\test 4. Type the following bjam "-sTOOLS=vc-7_1" That's it (at least it works for me), this builds and runs all the tests. No need to specify --builddir or other such options. If you want to use other compilers and/or know more about bjam then these are good places to start: http://www.boost.org/more/getting_started.html http://www.boost.org/tools/build/v1/build_system.htm
To be honest, I have made several attempts at using bjam, but the only thing I can get to work is a toplevel make of everything. So, for all my own stuff, I have been using a mirror hierarchy and Makefiles (since that is what I have been using for the last 2 decades).
However, I now want to get some code ready for submission (I have moved type_id and in the process have written a dynamic library wrapper as well). Unfortunately, I can not get my tests to integrate very well within boost. Thus, I humbly ask for any pointers and/or assistance in this regard.
How do you want to integrate? Do you want to run your tests as a part of all the other tests? I wouldn't know how to do that but I think you don't need to if you want to prepare a submission. IMO, all that's necessary is that your tests and examples build/run from their respective subdirectories. HTH, -- Andreas Huber When replying by private email, please remove the words spam and trap from the address shown in the header.

On Sat, 22 Jan 2005 12:44:43 +0100 "Andreas Huber" <ahd6974-spamgroupstrap@yahoo.com> wrote:
How do you want to integrate? Do you want to run your tests as a part of all the other tests? I wouldn't know how to do that but I think you
don't need to if you want to prepare a submission. IMO, all that's necessary is that your tests and examples build/run from their respective subdirectories.
Basically, I would like to build tests so that they do the "right" thing w.r.t. all other boost tests. I would like to be able to run from the top, with all tests, and also stand alone. I would also like it to integrate properly with the command line options and so on, but I am beginning to think that none of the tests can do this as it is...

Jody Hagins wrote:
On Sat, 22 Jan 2005 12:44:43 +0100 "Andreas Huber" <ahd6974-spamgroupstrap@yahoo.com> wrote:
How do you want to integrate? Do you want to run your tests as a part of all the other tests? I wouldn't know how to do that but I think you don't need to if you want to prepare a submission. IMO, all that's necessary is that your tests and examples build/run from their respective subdirectories.
Basically, I would like to build tests so that they do the "right" thing w.r.t. all other boost tests.
I would like to be able to run from the top, with all tests, and also stand alone. I would also like it to integrate properly with the command line options and so on, but I am beginning to think that none of the tests can do this as it is...
If by "top" you mean boost-root.. Tests never build or run from that location. The regression test machines run "all" tests from the boost-root/status directory. When a library is added to Boost the library author adds a reference to their library tests in the boost-root/status/Jamfile (if you take a look it should be obvious from the examples there). But before a library is accepted and hence is not added to Boost you should only need to run the tests for the library from library-root/libs/<library>/test, which should have a Jamfile. All the fancy options that you see when you are at the boost-root, and do "bjam --help", are only available at that location. And are only intended for build+install for the libraries that need it, and for the headers. That is, it's a _user_ convenience, library developers have to deal with Boost.Build directly. Hope this clarifies some things for you. -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq

Jody Hagins <jody-boost-011304@atdesk.com> writes:
I apologize in advance. I can not figure out how to get tests to build and run correctly from within subdirectories. The --builddir option does not seem to be honored, and the Jamfiles are so "simple" that I haven't a clue as to what is happening.
You have to tell us something about what you tried and what response you got.
To be honest, I have made several attempts at using bjam, but the only thing I can get to work is a toplevel make of everything. So, for all my own stuff, I have been using a mirror hierarchy and Makefiles (since that is what I have been using for the last 2 decades).
However, I now want to get some code ready for submission (I have moved type_id and in the process have written a dynamic library wrapper as well). Unfortunately, I can not get my tests to integrate very well within boost. Thus, I humbly ask for any pointers and/or assistance in this regard.
most tests can be built with bjam test but as I said, we may need more info about your particular problem. -- Dave Abrahams Boost Consulting www.boost-consulting.com

On Sat, 22 Jan 2005 07:02:30 -0500 David Abrahams <dave@boost-consulting.com> wrote:
You have to tell us something about what you tried and what response you got.
OK. I built boost from the top, putting all the created object files into a separate directory, using the --builddir option... cd ${BOOST_ROOT} bjam "-sTOOLS=gcc" "--builddir=/home/jody/boost-build" This worked as advertised, putting all build object files and libraries in that directory. However, I want to run tests from within a subdirectory, because I do not want to run all of them. I am trying to figure out how I should write my own Jamfile to accomodate this, so I went to a few other lib test directories to see how they do it. However, I can not seem to get even those to do what I want. For example... shandalle:jody> cd ${BOOST_ROOT}/libs/smart_ptr/test shandalle:jody> bjam -sTOOLS=gcc --builddir=/home/jody/boost-build ...found 310 targets... ...updating 57 targets... MkDir1 ../../../bin/boost/libs/smart_ptr MkDir1 ../../../bin/boost/libs/smart_ptr/test MkDir1 ../../../bin/boost/libs/smart_ptr/test/intrusive_ptr_test.test MkDir1 ../../../bin/boost/libs/smart_ptr/test/intrusive_ptr_test.test/gcc MkDir1 ../../../bin/boost/libs/smart_ptr/test/intrusive_ptr_test.test/gcc/debug gcc-C++-action ../../../bin/boost/libs/smart_ptr/test/intrusive_ptr_test.test/gcc/debu g/intrusive_ptr_test.o gcc-Link-action ../../../bin/boost/libs/smart_ptr/test/intrusive_ptr_test.test/gcc/debu g/intrusive_ptr_test Chmod1 ../../../bin/boost/libs/smart_ptr/test/intrusive_ptr_test.test/gcc/debu g/intrusive_ptr_test MkDir1 ../../../bin/boost/libs/smart_ptr/test/get_deleter_test.test MkDir1 ../../../bin/boost/libs/smart_ptr/test/get_deleter_test.test/gcc MkDir1 ../../../bin/boost/libs/smart_ptr/test/get_deleter_test.test/gcc/debug gcc-C++-action ../../../bin/boost/libs/smart_ptr/test/get_deleter_test.test/gcc/debug/ get_deleter_test.o and so on. As you can see, it ignores the --builddir command line option. This is the source of my first confusion since the documentation indicates that bjam will "find" the Jamrules for the project (which it obviously does, or it would not know how to build everything, I imagine). I get similar behavior in other subdirectories. Since running in a subdir is probably common, I imagine I am missing something,... In addition, I will need to do something "special" in the test, and I can ont find a good example in other test Jamfiles. For my test, I need to create a shared library locally for testing, but I do not want it installed anywhere. I simply need it for testing the dll code ability to open/close/find symbols. Again, thanks for indulging my obvious thick head in regard to this issue.

On Sat, 22 Jan 2005 10:07:19 -0500, Jody Hagins wrote
and so on. As you can see, it ignores the --builddir command line option. This is the source of my first confusion since the documentation indicates that bjam will "find" the Jamrules for the project (which it obviously does, or it would not know how to build everything, I imagine).
I get similar behavior in other subdirectories. Since running in a subdir is probably common, I imagine I am missing something,...
I don't know if this will help, but I think the source of you problem is --builddir. When I run tests for date_time I simply change to libs/date_time/test and type bjam --verbose-test I don't build the library first. Since the tests depend on the library bjam dutifully builds them somewhere into BOOST_ROOT/bin/.... verbose-test makes the output of the test be displayed during execution.
In addition, I will need to do something "special" in the test, and I can ont find a good example in other test Jamfiles. For my test, I need to create a shared library locally for testing, but I do not want it installed anywhere. I simply need it for testing the dll code ability to open/close/find symbols.
You'll need a bjam guru for that one.... HTH, Jeff

Jody Hagins wrote:
and so on. As you can see, it ignores the --builddir command line option. This is the source of my first confusion since the documentation indicates that bjam will "find" the Jamrules for the project (which it obviously does, or it would not know how to build everything, I imagine).
I get similar behavior in other subdirectories. Since running in a subdir is probably common, I imagine I am missing something,...
Yes running in a subdir is common.. But placing the build results outside of the Boost tree is not common for developers. What the boost-root/Jamfile does is it translates all those autoconf like switches into variables and targets Boost.Build understands. In the case of "--builddir" it translates it to the global "ALL_LOCATE_TARGET". We know the docs are not good on this.. But here's the relevant info: http://www.boost.org/tools/build/v1/build_system.htm#user_globals So if you are in the test subdir you would: bjam "-sTOOLS=gcc" "-sALL_LOCATE_TARGET=/home/jody/boost-build"
In addition, I will need to do something "special" in the test, and I can ont find a good example in other test Jamfiles. For my test, I need to create a shared library locally for testing, but I do not want it installed anywhere. I simply need it for testing the dll code ability to open/close/find symbols.
No so special.. Boost.Config does just that also. Look at libs/config/test/link/Jamfile which declares the LIBs and DLLs. It's probably a good idea to have it as config has it in a subdirectory, as it lets you test just that build by itself. And in your library-root/libs/<library>/test/Jamfile you add references to those libraries. In the case of Boost.Config it's tests are directly in status/Jamfile: test-suite config : [ run libs/config/test/config_test.cpp : #args : #input-files : #requirements <threading>multi <no-warn>config_test.cpp ] [ run libs/config/test/config_info.cpp : : : <test-info>always_show_run_output ] [ run libs/config/test/abi/abi_test.cpp libs/config/test/abi/main.cpp ] [ run libs/config/test/limits_test.cpp <lib>../libs/test/build/boost_test_exec_monitor ] [ run libs/config/test/link/main.cpp <dll>../libs/config/test/link/link_test : #args : #input-files : #requirements <runtime-link>dynamic <define>BOOST_DYN_LINK=1 <define>BOOST_CONFIG_NO_LIB=1 : config_link_test ] [ compile-fail libs/config/test/threads/test_thread_fail1.cpp ] [ compile-fail libs/config/test/threads/test_thread_fail2.cpp ] ; But you can do the same in you test/Jamfile. Above the reference to the DLL is "<dll>../libs/config/test/link/link_test", of course you would use different paths ;-) -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq

But you can do the same in you test/Jamfile. Above the reference to the DLL is "<dll>../libs/config/test/link/link_test", of course you would use different paths ;-)
I think Jody wants something different: to test dlopen, which means not linking to the dll, but having the application "know" where it's located at runtime. That's rather harder, but it should be possible for bjam to figure out the path and pass it to the exe on the command line? John.

If you want to see how someone else does it, you can look in your directory $(BOOST_ROOT)/libs/serialization/libs/test for the shell scripts and batch files runtest.bat, runtest.ksh and runtest.sh . These work for me. Robert Ramey Jody Hagins wrote:
I apologize in advance. I can not figure out how to get tests to build and run correctly from within subdirectories. The --builddir option does not seem to be honored, and the Jamfiles are so "simple" that I haven't a clue as to what is happening.
To be honest, I have made several attempts at using bjam, but the only thing I can get to work is a toplevel make of everything. So, for all my own stuff, I have been using a mirror hierarchy and Makefiles (since that is what I have been using for the last 2 decades).
However, I now want to get some code ready for submission (I have moved type_id and in the process have written a dynamic library wrapper as well). Unfortunately, I can not get my tests to integrate very well within boost. Thus, I humbly ask for any pointers and/or assistance in this regard.
Thanks!
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (7)
-
Andreas Huber
-
David Abrahams
-
Jeff Garland
-
Jody Hagins
-
John Maddock
-
Rene Rivera
-
Robert Ramey