]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: avoid realpath in test-lib.sh
authorEric Blake <eblake@redhat.com>
Mon, 1 Feb 2016 18:43:32 +0000 (11:43 -0700)
committerEric Blake <eblake@redhat.com>
Mon, 1 Feb 2016 20:03:28 +0000 (13:03 -0700)
Ever since commit ace4aecd, running 'make check' on RHEL 6 produces:

./test-lib.sh: line 21: realpath: command not found

for every shell script test, because 'realpath' was not part of
coreutils back then.

* tests/test-lib.sh (_scriptdir): Compute with only portable shell.

Signed-off-by: Eric Blake <eblake@redhat.com>
tests/test-lib.sh

index 920b01e3f87bbcae5ff39fc1ea6d8c509545217d..8e0ce83e118c4fba059b526ebfdc1e1a9831495e 100644 (file)
@@ -1,6 +1,6 @@
 # test-lib.sh: source this file; set up for tests
 
-# Copyright (C) 2008-2013 Red Hat, Inc.
+# Copyright (C) 2008-2013, 2016 Red Hat, Inc.
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -18,7 +18,7 @@
 #
 # Based on an idea from GNU coreutils
 
-_scriptdir="$(realpath $(dirname $0))"
+_scriptdir="$(unset CDPATH; cd $(dirname $0) && pwd)"
 test -z "$abs_srcdir" && abs_srcdir=$_scriptdir
 test -z "$abs_builddir" && abs_builddir=$_scriptdir
 test -z "$abs_top_srcdir" && abs_top_srcdir=$_scriptdir/..