libelektra icon indicating copy to clipboard operation
libelektra copied to clipboard

external tests should not fail if source is not available.

Open markus2330 opened this issue 6 years ago • 2 comments

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

markus2330 avatar Mar 22 '19 07:03 markus2330

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.

kodebach avatar Mar 22 '19 16:03 kodebach

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.

markus2330 avatar Mar 22 '19 16:03 markus2330