diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2021-11-30 15:11:43 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2021-11-30 17:22:18 -0800 |
commit | 5598b8612b095d9f5f513ada2a4bbacaca1bfea8 (patch) | |
tree | 2e5deeba37adb017421b2088cca051afd9dc265e | |
parent | 3d6519f11867183b9698cbf8cc9515bc767b98af (diff) | |
download | xorg-app-xauth-5598b8612b095d9f5f513ada2a4bbacaca1bfea8.tar.gz |
tests: make tests work in out-of-tree builds
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rwxr-xr-x | tests/010-xauth-add-inet.script | 4 | ||||
-rwxr-xr-x | tests/020-xauth-add-local.script | 4 | ||||
-rwxr-xr-x | tests/030-xauth-extract.script | 4 | ||||
-rwxr-xr-x | tests/040-xauth-source.script | 4 | ||||
-rwxr-xr-x | tests/090-xauth-bad-usage.script | 4 | ||||
-rwxr-xr-x | tests/test_xauth | 11 |
6 files changed, 16 insertions, 15 deletions
diff --git a/tests/010-xauth-add-inet.script b/tests/010-xauth-add-inet.script index 326a2de..89a3321 100755 --- a/tests/010-xauth-add-inet.script +++ b/tests/010-xauth-add-inet.script @@ -1,7 +1,7 @@ #!/bin/sh -# setup the test ennvironment inside this shell -. ./setup-sourced +# setup the test environment inside this shell +. ${srcdir:-.}/setup-sourced xauth add examplehost1/unix:0 MIT-MAGIC-COOKIE-1 b90b0fd1cf6a0e7a2c74c00000000001 xauth add examplehost2/unix:0 . b90b0fd1cf6a0e7a2c74c00000000002 diff --git a/tests/020-xauth-add-local.script b/tests/020-xauth-add-local.script index c8ccf9c..58d5b93 100755 --- a/tests/020-xauth-add-local.script +++ b/tests/020-xauth-add-local.script @@ -1,7 +1,7 @@ #!/bin/sh -# setup the test ennvironment inside this shell -. ./setup-sourced +# setup the test environment inside this shell +. ${srcdir:-.}/setup-sourced # Execute the test xauth add unix:0 . b90b0fd1cf6a0e7a2c74c00000000004 diff --git a/tests/030-xauth-extract.script b/tests/030-xauth-extract.script index 41733fb..f128685 100755 --- a/tests/030-xauth-extract.script +++ b/tests/030-xauth-extract.script @@ -1,7 +1,7 @@ #!/bin/sh -# setup the test ennvironment inside this shell -. ./setup-sourced +# setup the test environment inside this shell +. ${srcdir:-.}/setup-sourced # Execute the test xauth add examplehost1/unix:0 . b90b0fd1cf6a0e7a2c74c00000000001 diff --git a/tests/040-xauth-source.script b/tests/040-xauth-source.script index 5eceb4c..fbe21fa 100755 --- a/tests/040-xauth-source.script +++ b/tests/040-xauth-source.script @@ -1,7 +1,7 @@ #!/bin/sh -# setup the test ennvironment inside this shell -. ./setup-sourced +# setup the test environment inside this shell +. ${srcdir:-.}/setup-sourced # Execute the test CMDFILE=${DATADIR:-/tmp}/xauth-cmdfile diff --git a/tests/090-xauth-bad-usage.script b/tests/090-xauth-bad-usage.script index 360e9e4..f77df18 100755 --- a/tests/090-xauth-bad-usage.script +++ b/tests/090-xauth-bad-usage.script @@ -1,7 +1,7 @@ #!/bin/sh -# setup the test ennvironment inside this shell -. ./setup-sourced +# setup the test environment inside this shell +. ${srcdir:-.}/setup-sourced # Execute the test diff --git a/tests/test_xauth b/tests/test_xauth index 27d999b..e04d13c 100755 --- a/tests/test_xauth +++ b/tests/test_xauth @@ -6,22 +6,23 @@ # If no difference is found, the test is assumed as PASS (otherwise FAIL) # total_ret=0 -for script in `ls -1 ./*.script | sort` ; do +testsrc="${srcdir:-.}" +for script in `ls -1 ${testsrc}/*.script | sort` ; do base=`basename $script .script` echo "Testing $base" $script > out.stdout 2> out.stderr # check stdout for correctness - if [ -f $base.stdout ]; then - diff out.stdout $base.stdout + if [ -f ${testsrc}/$base.stdout ]; then + diff out.stdout ${testsrc}/$base.stdout ret_stdout=$? else ret_stdout=0 fi # check stderr for correctness - if [ -f $base.stderr ]; then - diff out.stderr $base.stderr + if [ -f ${testsrc}/$base.stderr ]; then + diff out.stderr ${testsrc}/$base.stderr ret_stderr=$? else ret_stderr=0 |