Make `make test` work on release builds

This is a set of patches which makes sure that the test datafiles (*.xml) are made available at the same time as the test programs are built, so that they are present when doing `make test` (or `make check`, which works as before)