From: Brendan M. <mc...@cs...> - 2005-03-02 03:35:57
|
G'day vxl-ers, I'm having some trouble incorporating automatic tests into my code (it seems to work fine whilst building vxl itself though). In particular, I'm not really sure of the process as there doesn't seem to be any detailed documentation about it. I've tried copying other testing examples from elsewhere in vxl with limited success. I can get the tests to compile no problems, but the tests aren't automatically run at compile time. I'm using the cvs version of vxl from 21st feb 2005. Following is a copy of the CMakeLists.txt file from my testing directory. I have a SUBDIRS(tests) line in my main CMakeLists.txt file that is executed unconditionally. ########################## # tests/CMakeLists.txt INCLUDE_DIRECTORIES( ${VXL_VCL_INCLUDE_DIR} ${VXLCORE_INCLUDE_DIR} ${VXL_MUL_INCLUDE_DIR} ${VXL_OUL_INCLUDE_DIR} ${XERCES_DIR}/include ${VXL_TESTLIB_INCLUDE_DIR} ) ADD_EXECUTABLE( saim_test_all # Driver source and utilities test_driver.cxx # The tests test_discrete_pdf.cxx ) TARGET_LINK_LIBRARIES(saim_test_all pdf1d vil_algo vil vnl vpl vul vcl vbl testlib ${CMAKE_THREAD_LIBS}) ADD_TEST( test_discrete_pdf saim_test_all test_discrete_pdf) # end CMakeLists.txt ##################### Following is an example make output if I change the code in my main directory: ######################### cd /home/brendan/research/projects/SAIM/ make -k make cmake.depends make[1]: Entering directory `/home/brendan/transfer/research/projects/SAIM' make[1]: `cmake.depends' is up to date. make[1]: Leaving directory `/home/brendan/transfer/research/projects/SAIM' make cmake.check_depends make[1]: Entering directory `/home/brendan/transfer/research/projects/SAIM' Building dependencies cmake.check_depends... /usr/local/bin/cmake -S/home/brendan/transfer/research/projects/SAIM -O/home/brendan/transfer/research/projects/SAIM -H/home/brendan/transfer/research/projects/SAIM -B/home/brendan/transfer/research/projects/SAIM make[1]: Leaving directory `/home/brendan/transfer/research/projects/SAIM' make -f cmake.check_depends make[1]: Entering directory `/home/brendan/transfer/research/projects/SAIM' make[1]: Leaving directory `/home/brendan/transfer/research/projects/SAIM' make all make[1]: Entering directory `/home/brendan/transfer/research/projects/SAIM' Building object file build_models.o... c++ -o build_models.o -Wall -g -I/home/brendan/transfer/research/projects/SAIM -I/home/brendan/vxl/linuxbin/vcl -I/home/brendan/vxl/vcl -I/home/brendan/vxl/linuxbin/core -I/home/brendan/vxl/core -I/home/brendan/vxl/contrib/mul -I/home/brendan/vxl/contrib/oul -I/home/brendan/transfer/local/xerces-c-src_2_6_0/include -c /home/brendan/transfer/research/projects/SAIM/build_models.cc Building executable /home/brendan/transfer/research/projects/SAIM/build_models... c++ -Wall -g -fPIC build_models.o cla_files.o iterated_closest_point.o EigenModel.o Vertebra_AAM.o my_easy2d_tableau.o -o /home/brendan/transfer/research/projects/SAIM/build_models -rdynamic -L/home/brendan/vxl/linuxbin/lib -L/home/brendan/transfer/local/xerces-c-src_2_6_0/lib -L/usr/local/lib -L/usr/X11R6/lib -lxerces-c -louml -lvgui -lvil_algo -lvsl -lvil -lvul -lvcl -lvbl -lvil1 -lvgl -lvpl -lglut -lXmu -lXi -lQv -lGLU -lGL -lX11 -lXext -lX11 -lXext -lX11 -lXext -lvnl_algo -lnetlib -lvnl -ljpeg -ltiff -lpng -lz -lvcl -lm -Wl,-rpath,/home/brendan/vxl/linuxbin/lib:/home/brendan/transfer/local/xerces-c-src_2_6_0/lib:/usr/local/lib:/usr/X11R6/lib /home/brendan/transfer/research/projects/SAIM/tests: building default_target make[2]: Entering directory `/home/brendan/transfer/research/projects/SAIM/tests' make cmake.depends make[3]: Entering directory `/home/brendan/transfer/research/projects/SAIM/tests' make[3]: `cmake.depends' is up to date. make[3]: Leaving directory `/home/brendan/transfer/research/projects/SAIM/tests' make cmake.check_depends make[3]: Entering directory `/home/brendan/transfer/research/projects/SAIM/tests' make[3]: `cmake.check_depends' is up to date. make[3]: Leaving directory `/home/brendan/transfer/research/projects/SAIM/tests' make -f cmake.check_depends make[3]: Entering directory `/home/brendan/transfer/research/projects/SAIM/tests' make[3]: Leaving directory `/home/brendan/transfer/research/projects/SAIM/tests' make all make[3]: Entering directory `/home/brendan/transfer/research/projects/SAIM/tests' make[3]: Nothing to be done for `all'. make[3]: Leaving directory `/home/brendan/transfer/research/projects/SAIM/tests' make[2]: Leaving directory `/home/brendan/transfer/research/projects/SAIM/tests' make[1]: Leaving directory `/home/brendan/transfer/research/projects/SAIM' Compilation finished at Wed Mar 2 16:32:52 ################################## And if I change the test code: ################## cd /home/brendan/research/projects/SAIM/ make -k make cmake.depends make[1]: Entering directory `/home/brendan/transfer/research/projects/SAIM' make[1]: `cmake.depends' is up to date. make[1]: Leaving directory `/home/brendan/transfer/research/projects/SAIM' make cmake.check_depends make[1]: Entering directory `/home/brendan/transfer/research/projects/SAIM' make[1]: `cmake.check_depends' is up to date. make[1]: Leaving directory `/home/brendan/transfer/research/projects/SAIM' make -f cmake.check_depends make[1]: Entering directory `/home/brendan/transfer/research/projects/SAIM' make[1]: Leaving directory `/home/brendan/transfer/research/projects/SAIM' make all make[1]: Entering directory `/home/brendan/transfer/research/projects/SAIM' /home/brendan/transfer/research/projects/SAIM/tests: building default_target make[2]: Entering directory `/home/brendan/transfer/research/projects/SAIM/tests' make cmake.depends make[3]: Entering directory `/home/brendan/transfer/research/projects/SAIM/tests' make[3]: `cmake.depends' is up to date. make[3]: Leaving directory `/home/brendan/transfer/research/projects/SAIM/tests' make cmake.check_depends make[3]: Entering directory `/home/brendan/transfer/research/projects/SAIM/tests' Building dependencies cmake.check_depends... /usr/local/bin/cmake -S/home/brendan/transfer/research/projects/SAIM/tests -O/home/brendan/transfer/research/projects/SAIM/tests -H/home/brendan/transfer/research/projects/SAIM -B/home/brendan/transfer/research/projects/SAIM make[3]: Leaving directory `/home/brendan/transfer/research/projects/SAIM/tests' make -f cmake.check_depends make[3]: Entering directory `/home/brendan/transfer/research/projects/SAIM/tests' make[3]: Leaving directory `/home/brendan/transfer/research/projects/SAIM/tests' make all make[3]: Entering directory `/home/brendan/transfer/research/projects/SAIM/tests' Building object file test_discrete_pdf.o... c++ -o test_discrete_pdf.o -Wall -g -I/home/brendan/transfer/research/projects/SAIM/tests -I/home/brendan/vxl/linuxbin/vcl -I/home/brendan/vxl/vcl -I/home/brendan/vxl/linuxbin/core -I/home/brendan/vxl/core -I/home/brendan/vxl/contrib/mul -I/home/brendan/vxl/contrib/oul -I/home/brendan/transfer/local/xerces-c-src_2_6_0/include -c /home/brendan/transfer/research/projects/SAIM/tests/test_discrete_pdf.cxx Building executable /home/brendan/transfer/research/projects/SAIM/tests/saim_test_all... c++ -Wall -g -fPIC test_driver.o test_discrete_pdf.o -o /home/brendan/transfer/research/projects/SAIM/tests/saim_test_all -rdynamic -L/home/brendan/vxl/linuxbin/lib -L/home/brendan/transfer/local/xerces-c-src_2_6_0/lib -lpdf1d -lvil_algo -lvil -lvnl -lvpl -lvul -lvcl -lvbl -ltestlib -lmbl -lvgl_io -lvgl -lvnl_io -lvsl -lvnl_algo -lnetlib -lvnl -ljpeg -ltiff -lpng -lz -lvcl -lm -Wl,-rpath,/home/brendan/vxl/linuxbin/lib:/home/brendan/transfer/local/xerces-c-src_2_6_0/lib make[3]: Leaving directory `/home/brendan/transfer/research/projects/SAIM/tests' make[2]: Leaving directory `/home/brendan/transfer/research/projects/SAIM/tests' make[1]: Leaving directory `/home/brendan/transfer/research/projects/SAIM' Compilation finished at Wed Mar 2 16:34:46 ################## Note that the tests were compiled fine, just not executed. So what am I doing wrong here? -- Cheers, Brendan. ---------------------------------------------------------------------------- Brendan McCane Email: mc...@cs... Department of Computer Science Phone: +64 3 479 8588/8578. University of Otago Fax: +64 3 479 8529 Box 56, Dunedin, New Zealand. |