Cirrus: Uninstall Elektra after testing on macOS
@@ -104,6 +104,7 @@ mac_task:
qt
shfmt
swig
+ tree
xerces-c
yaep
yajl
@@ -131,6 +132,7 @@ mac_task:
- > # Use latest version of LLVM to translate Elektra
export CC=/usr/local/opt/llvm/bin/clang CXX=/usr/local/opt/llvm/bin/clang++
- SYSTEM_DIR="$PWD/kdbsystem"
+ - INSTALL_DIR="$PWD/install"
- mkdir build && cd build
- |
CMAKE_OPTIONS=(
@@ -138,6 +140,7 @@ mac_task:
-DBUILD_FULL="${BUILD_FULL:-OFF}"
-DBUILD_SHARED="${BUILD_SHARED:-ON}"
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
+ -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR"
-DCOMMON_FLAGS="${COMMON_FLAGS:--Werror}"
-DENABLE_ASAN="${ENABLE_ASAN:-OFF}"
-DENABLE_DEBUG=ON
@@ -159,8 +162,9 @@ mac_task:
- output="$(ninja install 2>&1)" || printf '%s' "$output"
tests_script:
+ - export PATH=$PATH:"$PWD/install/bin"
- cd build
- - |
+ - | # Run tests
if [[ "$ENABLE_ASAN" == 'ON' ]]; then
ninja run_nocheckshell
elif [[ "$BUILD_FULL" == 'ON' ]]; then
@@ -168,3 +172,13 @@ mac_task:
else
ninja run_all && kdb run_all
fi
+ - | # Uninstall Elektra
+ output="$(ninja uninstall 2>&1)" || printf '%s' "$output"
+ - | # Make sure uninstalling removes all files
+ cd ../install
+ if find . -name '*' | grep -Eqv '^.$'; then
+ printf 'The command `ninja uninstall` did not uninstall all files:\n'
+ tree .
+ printf '. Please add the files shown above to `ElektraUninstall.cmake`.\n'
+ false
+ fi
