From 6ffd51099014f63db88ed432d8083cce2fb49357 Mon Sep 17 00:00:00 2001 From: guigues Date: Wed, 7 Jan 2009 09:52:38 +0000 Subject: [PATCH 1/1] *** empty log message *** --- ctest/README.txt | 49 ++++++++++++++ ctest/crea-linux.ctest | 142 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 191 insertions(+) create mode 100644 ctest/README.txt create mode 100644 ctest/crea-linux.ctest diff --git a/ctest/README.txt b/ctest/README.txt new file mode 100644 index 0000000..8d449f1 --- /dev/null +++ b/ctest/README.txt @@ -0,0 +1,49 @@ +This folder provides ctest scripts to automatically build a creatool, +test and submit results to creatis dashboard. + +---------------- + INSTRUCTIONS +---------------- + +* All ctest script files in this folder have the following format : + PROJECT-OS.ctest (e.g. crea-linux.ctest for crea project on linux platforms) + +* The default configuration is to build and run the tests in ${HOME}/dashboard + This location is stored by ctest in the var CTEST_DASHBOARD_ROOT + +* You have to : + +1) Create a initial CMakeCache.txt corresponding to your machine config : + + a) Checkout the project to test + b) Configure the project manually with cmake (ccmake or CMakeSetup) setting your system/install specific options (libraries paths, options, build type, ...) + c) Copy the file CMakeCache.txt of the build tree to your testing directory (where you will run ctest, usually the same than CTEST_DASHBOARD_ROOT) giving it a proper name (PROJECT-BUILDTYPE-CMakeCache.txt, e.g. crea-debug-CMakeCache.txt) + d) Edit the copied file and comment out (type an initial #) all lines which make explicit reference to the build directory (the directory where you configured with cmake, use the 'find' tool of your editor). Typically for crea, I commented out the following lines : + #//Value Computed by CMake + #crea_BINARY_DIR:STATIC=/home/guigues/coding/Build/crea + #//Value Computed by CMake + #crea_SOURCE_DIR:STATIC=/home/guigues/coding/CreaTools/crea + #//This is the directory where this CMakeCahe.txt was created + #CMAKE_CACHEFILE_DIR:INTERNAL=/home/guigues/coding/Build/crea + #//Start directory with the top level CMakeLists.txt file for this + #// project + #CMAKE_HOME_DIRECTORY:INTERNAL=/home/guigues/coding/CreaTools/crea + + +2) Copy the right ctest file to another filename, + e.g. copy crea-linux to crea-mymachine-debug.ctest + Typically put it in CTEST_DASHBOARD_ROOT + +3) Edit the new file and set : + * The architecture description, typically os+compiler with versions + e.g. fc9-gcc4.3.0, win32-vs8, etc. + * The build type, e.g. debug, release... + * The name of the CMakeCache.txt file to use as initial cache file (see 3) below) + * You can also customize the CTEST_DASHBOARD_ROOT folder + +4) Run ctest with the script, typically : +> ctest -S crea-linux-mymachine-debug.ctest -V + + +* To schedule automatic build, see : + http://www.vtk.org/Wiki/CMake_Scripting_Of_CTest diff --git a/ctest/crea-linux.ctest b/ctest/crea-linux.ctest new file mode 100644 index 0000000..dc34949 --- /dev/null +++ b/ctest/crea-linux.ctest @@ -0,0 +1,142 @@ +# LG 06/01/08 +# Adapted from vtk dashboard : arkadia.kitware all-debug-g++ +# +# Style note: to distinguish between variables recognized by cmake/ctest and +# user-defined variables, user-defined ones are declared lower case +# Style note: lower case flavor of the cmake commands is used. + +cmake_minimum_required(VERSION 2.6) + + +################################################################# +## MANDATORY +set(arch "fc9") +set(buildtype "debug") +set(CMakeCacheFile "crea-debug-CMakeCache.txt") +################################################################# + +################################################################# +## CAN BE CHANGED : +set(CTEST_DASHBOARD_ROOT "$ENV{HOME}/dashboards") +set(MODEL Experimental) +################################################################# + +################################################################# +# NOTHING FOR USER BELOW +set(project_name "crea") + +set(CTEST_SITE "$ENV{HOSTNAME}") +set(CTEST_BUILD_NAME "${project_name}-${CTEST_SITE}-${arch}-${buildtype}") + +set(source_dir ${project_name}) +#set(extra_source_dir "VTKData") +set(build_dir ${CTEST_BUILD_NAME}) +set(CTEST_TEST_TIMEOUT 140) # 70 seconds. 70 seconds is probably not enough when coverage is ON. + +set(CTEST_CMAKE_GENERATOR "Unix Makefiles") +set(CTEST_BUILD_COMMAND "make -j3") + + +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${source_dir}") +set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${build_dir}") + +set(CTEST_COVERAGE_COMMAND "/usr/bin/gcov") # REQUIRED with new ctest script style. + +# --coverage: -fprofile-arcs -ftest-coverage (when compiling) +# --coverage: -lgcov (when linking) + +ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) + +# Common C/C++ flags: +set(advanced_flags) +#set(advanced_flags"-Wpointer-arith -Winvalid-pch -Wcast-align -Wwrite-strings -fstack-protector-all -D_FORTIFY_SOURCE=2 -Wconversion") + +set(cov_options "-fprofile-arcs -ftest-coverage") + +set(common_flags "-fdiagnostics-show-option -Wall -Wextra -Wshadow ${advanced_flags} ${cov_options}") + +# C specific flags: +set(advanced_c_flags) +#set(advanced_c_flags "-Wtraditional-conversion") + +# C++ specific flags: +set(advanced_cxx_flags) +#set(advanced_cxx_flags "-Wstrict-null-sentinel -Wsign-conversion -Wsign-promo") + +#MESSAGE(STATUS ${CTEST_SCRIPT_DIRECTORY}) + +configure_file( + ${CTEST_SCRIPT_DIRECTORY}/${CMakeCacheFile} + ${CTEST_BINARY_DIRECTORY}/CMakeCache.txt + COPY_ONLY) + +# Write initial cache. +#file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" " +#MAKECOMMAND:STRING=make -j3 -k +#CMAKE_CXX_FLAGS:STRING=${common_flags} ${advanced_cxx_flags} -Woverloaded-virtual +#CMAKE_CXX_FLAGS_DEBUG:STRING=-O0 -ggdb +#CMAKE_C_FLAGS:STRING=${common_flags} ${advanced_c_flags} +#CMAKE_C_FLAGS_DEBUG:STRING=-O0 -ggdb +#CMAKE_EXE_LINKER_FLAGS:STRING=${cov_options} +#CMAKE_SHARED_LINKER_FLAGS:STRING=${cov_options} +#CMAKE_BUILD_TYPE:STRING=Debug +#BUILD_SHARED_LIBS:BOOL=ON +#VTK_DEBUG_LEAKS:BOOL=ON +#BUILD_DOCUMENTATION:BOOL=ON +#BUILD_EXAMPLES:BOOL=ON +#JAVA_AWT_INCLUDE_PATH:PATH=/usr/lib/jvm/java-6-sun/include +#JAVA_AWT_LIBRARY:FILEPATH=/usr/lib/jvm/java-6-sun/jre/lib/i386/libjawt.so +#JAVA_INCLUDE_PATH:PATH=/usr/lib/jvm/java-6-sun/include +#JAVA_INCLUDE_PATH2:PATH=/usr/lib/jvm/java-6-sun/include/linux +#VTK_USE_BOOST:BOOL=ON +# GL2PS test broken +#VTK_USE_GL2PS:BOOL=OFF +#VTK_WRAP_JAVA:BOOL=ON +#VTK_WRAP_PYTHON:BOOL=ON +#VTK_WRAP_TCL:BOOL=ON +#VTK_USE_GUISUPPORT:BOOL=ON +#VTK_USE_QVTK:BOOL=ON +#DESIRED_QT_VERSION:STRING=4 +#VTK_USE_ODBC:BOOL=ON +#ODBC_INCLUDE_DIRECTORIES:PATH=/usr/include +#ODBC_LIBRARY:FILEPATH=/usr/lib/libodbc.so +#VTK_USE_MYSQL:BOOL=ON +#VTK_USE_POSTGRES:BOOL=ON +#VTK_LEGACY_REMOVE:BOOL=ON +#") + +set(CTEST_UPDATE_COMMAND "cvs") + +# set any extra directories to do an update on +if(NOT EXISTS "${CTEST_DASHBOARD_ROOT}/${source_dir}") + message("Initial checkout of ${project_name}") + execute_process( + COMMAND "${CTEST_UPDATE_COMMAND}" -q -z3 co ${project_name} + WORKING_DIRECTORY "${CTEST_DASHBOARD_ROOT}" + ) +else(NOT EXISTS "${CTEST_DASHBOARD_ROOT}/${source_dir}") + execute_process( + COMMAND "${CTEST_UPDATE_COMMAND}" -q -z3 up "-PdA" + WORKING_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${source_dir}" + ) +endif(NOT EXISTS "${CTEST_DASHBOARD_ROOT}/${source_dir}") + +ctest_start(${MODEL}) +ctest_update(SOURCE "${CTEST_SOURCE_DIRECTORY}") +ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}") +ctest_read_custom_files("${CTEST_BINARY_DIRECTORY}") +ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}") + +# save LD_LIBRARY_PATH +#set(saved_ld_library_path "$ENV{LD_LIBRARY_PATH}") + +# Change it so that JavaRegression test can pass. +#set(ENV{LD_LIBRARY_PATH} "/usr/lib/jvm/java-6-sun/jre/lib/i386/xawt:${saved_ld_libray_path}") +ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}") +ctest_coverage(BUILD "${CTEST_BINARY_DIRECTORY}") +# restore LD_LIBRARY_PATH +#set(ENV{LD_LIBRARY_PATH} "${saved_ld_library_path}") + +#ctest_memcheck(BUILD "${CTEST_BINARY_DIRECTORY}") +#ctest_submit() -- 2.47.0