This ensures that the test programs get executed the same way as the binaries that are installed. (cherry picked from commit 74702ee00ecfd080d8ab11118cd25dbe6c437ec0)