libelektra
libelektra copied to clipboard
external tests should not fail if source is not available.
check_external_example and check_external_example_highlevel may fail when you run the tests without the source code, e.g.:
ELEKTRA CHECK EXTERNAL HIGHLEVEL
/usr/bin/pkg-config
Check if script tests the correct version
+ echo 'Testing build with cmake'
Testing build with cmake
+ cd /builddir/build/BUILD/elektra-0.8.26/examples/highlevel
/usr/lib64/elektra/tool_exec/check_external_example_highlevel: Zeile 1097: cd: /builddir/build/BUILD/elektra-0.8.26/examples/highlevel: Datei oder Verzeichnis nicht gefunden
+ mkdir build
mkdir: das Verzeichnis „build“ kann nicht angelegt werden: Keine Berechtigung
+ cd build
/usr/lib64/elektra/tool_exec/check_external_example_highlevel: Zeile 1099: cd: build: Datei oder Verzeichnis nicht gefunden
+ cmake ../cmake
Yes, my last change to these tests didn't take packaged versions of Elektra into account...
The tests rely on Elektra being installed and the source directory still being available, because they read the example sources from there. Instead we should just install the example sources to $prefix/share/elektra/examples ($prefix being the CMake install prefix), so they get shipped with Elektra. Then the tests can just read the sources from there.
Btw. the tests also rely on having build tools available (cmake,...)
We definitely should turn these tests off if the source dir cannot be found.