When working with the c-based test interface it is easy to mount an existing configuration file because you would just create a folder inside your plugin folder that has the same name and then the testframework takes care about it.
However, now i want to use such a file in a shell recorder test. Normally you'd find it in KDB_DB_SPEC so it can be mounted relatively using kdb mount prelude.ini spec/..... as the resolver searches for that file in the previously mentioned KDB_DB_SPEC folder.
However when you only build elektra without installing it, i have no idea how to refer to the file in the source folder instead as a fallback. Judging from the test recorder shell script i fear this is not supported is that right?
Mounting into the spec namespace takes an absolute file name, so a `pwd`/src/plugin.../prelude.ini should work fine.
Btw. I am not perfectly happy about the assumption that the current working directory is elektra's source dir, see #1982.
I would prefer if we have some variables set which allows the user to refer to the source dir.
@sanssecours what do you think?
Mounting into the spec namespace takes an absolute file name, so a
`pwd`/src/plugin.../prelude.inishould work fine.
Please also add double quotes around the folder:
mount "`pwd`/src/plugins/haskell/…" …
, otherwise the command will not work if the source directory contains space characters. You can also use the variable PWD as replacement for the command pwd:
echo "$PWD/src/plugins/haskell/…" …
.
Btw. I am not perfectly happy about the assumption that the current working directory is elektra's source dir, see #1982.
The proposed changes sound good to me.
I would prefer if we have some variables set which allows the user to refer to the source dir.
That is certainly a must have, if we execute tests in a random location. This behavior sounds also very similar to the way Cram handles this: Cram sets the variable TESTDIR to the location of the file under test.
This works. Thanks a lot! Do you want to leave this issue open for your current working dir assumption discussion or can we close it?
If everything is clear you can close it. The discussion about the working dir assumption already moved on to #1982.
Yes, everything is clear.