ENH: set expected failure for tests
[cmake.git] / Tests / TestInstall.sh.in
blob9535780506f17d7c247658cb045d39856530bc56
1 #!/bin/sh
3 CMAKE_COMMAND="@CMAKE_INSTALL_PREFIX@/bin/cmake"
4 CMake_SOURCE_DIR="@CMake_SOURCE_DIR@"
5 CMake_BINARY_DIR="@CMake_BINARY_DIR@"
6 CMAKE_INSTALL_PREFIX="@CMAKE_INSTALL_PREFIX@"
7 CMAKE_BUILD_TOOL="@CMAKE_BUILD_TOOL@"
9 SOURCE_DIR="${CMake_SOURCE_DIR}/Tests/Simple"
10 BINARY_DIR="${CMake_BINARY_DIR}/Tests/TestInstall"
12 install()
14 echo "Erasing ${CMAKE_INSTALL_PREFIX}" &&
15 ([ ! -d "${CMAKE_INSTALL_PREFIX}" ] || rm -rf "${CMAKE_INSTALL_PREFIX}") &&
16 mkdir -p "${CMAKE_INSTALL_PREFIX}" &&
17 echo "Running make install" &&
19 cd "${CMake_BINARY_DIR}" &&
20 "${CMAKE_BUILD_TOOL}" install
24 setup()
26 echo "Entering ${BINARY_DIR}" &&
27 cd "${BINARY_DIR}"
30 write_cache()
32 install || return 1
33 setup || return 1
34 echo "Writing CMakeCache.txt"
36 cat > CMakeCache.txt <<EOF
37 EOF
41 run_cmake()
43 write_cache || return 1
44 echo "Running CMake"
45 "${CMAKE_COMMAND}" "${SOURCE_DIR}"
48 run_make()
50 run_cmake || return 1
51 echo "Running ${CMAKE_BUILD_TOOL}"
52 "${CMAKE_BUILD_TOOL}"
55 run_test()
57 echo "Running ${BINARY_DIR}/simple"
59 "${BINARY_DIR}/simple"
63 run_make && run_test