diff options
author | Dan Dedrick <ddedrick@lexmark.com> | 2016-11-16 16:10:01 -0500 |
---|---|---|
committer | Dan Dedrick <ddedrick@lexmark.com> | 2016-11-16 16:10:01 -0500 |
commit | 37380cba4379897674d0ff8c5115f10691d4474a (patch) | |
tree | 1c7601a9e0768be96dfcf751b29105d3a77a6e05 /tests/test_bindfs.rb | |
parent | aceeb3c7145132d3b0eb839a043798b41a75b8c6 (diff) | |
download | bindfs-37380cba4379897674d0ff8c5115f10691d4474a.tar.gz |
tests: Fix run make check out of place
When building out of the place the executables are not in the same
location as the scripts being called. This means that the test scripts
need to be able to handle the executables being the in the current
directory and the script/source files being in a different directory.
This will work now work with both building in place and building out of
place and can be tested as follows:
/autogen.sh && mkdir -p build && cd build && ../configure && make check
Diffstat (limited to 'tests/test_bindfs.rb')
-rwxr-xr-x | tests/test_bindfs.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/test_bindfs.rb b/tests/test_bindfs.rb index 48611b2..39f709e 100755 --- a/tests/test_bindfs.rb +++ b/tests/test_bindfs.rb @@ -18,7 +18,10 @@ # along with bindfs. If not, see <http://www.gnu.org/licenses/>. # -require './common.rb' +# if we are being run by make check it will set srcdir and we should use it +localsrc_path = ENV['srcdir'] || '.' + +require localsrc_path + '/common.rb' include Errno @@ -39,7 +42,7 @@ $nobody_uid = nobody_uid = Etc.getpwnam('nobody').uid $nobody_gid = nobody_gid = Etc.getpwnam('nobody').gid $nobody_group = nobody_group = Etc.getgrgid(nobody_gid).name -$tests_dir = File.dirname(File.realpath(__FILE__)) +$tests_dir = File.realpath('.') testenv("") do |