Skip to content

Commit

Permalink
kpathsea/tests/kpse{access,readlink}.test: revert
Browse files Browse the repository at this point in the history
revert because it does not fit to Windows environment.
  • Loading branch information
t-tk committed Nov 5, 2023
1 parent 256536c commit 32bee52
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 29 deletions.
41 changes: 18 additions & 23 deletions source/texk/kpathsea/tests/kpseaccess.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,44 @@
# Copyright 2010 Peter Breitenlohner <[email protected]>
# You may freely use, modify and/or distribute this file.

BinDir=${BinDir:-.}
ExeExt=${ExeExt:-}
_kpseaccess=$BinDir/kpseaccess$ExeExt
_kpsewhich=$BinDir/kpsewhich$ExeExt

ret=0

pass () {
echo "***** unexpected success of '$_kpseaccess $@'"
echo "***** unexpected success of './kpseaccess $@'"
ret=77
}

fail () {
echo "***** unexpected failure of '$_kpseaccess $@'"
echo "***** unexpected failure of './kpseaccess $@'"
ret=77
}

$_kpseaccess '' nonesuch && exit 1
$_kpseaccess - nonesuch && exit 2
$_kpseaccess r nonesuch && exit 3
$_kpseaccess w nonesuch && exit 4
$_kpseaccess x nonesuch && exit 5
./kpseaccess '' nonesuch && exit 1
./kpseaccess - nonesuch && exit 1
./kpseaccess r nonesuch && exit 1
./kpseaccess w nonesuch && exit 1
./kpseaccess x nonesuch && exit 1

$_kpseaccess '' access.o || exit 6
$_kpseaccess - access.o || exit 7
$_kpseaccess rw access.o || exit 8
./kpseaccess '' access.o || exit 1
./kpseaccess - access.o || exit 1
./kpseaccess rw access.o || exit 1
# From the access(3p) POSIX manpage:
# If the process has appropriate privileges, an implementation may indicate
# success for X_OK even if none of the execute file permission bits are set.
$_kpseaccess x access.o && pass x access.o
./kpseaccess x access.o && pass x access.o

# Testing write access to kpseaccess itself might fail with ETXTBSY.
$_kpseaccess rwx $_kpsewhich || {
./kpseaccess rwx kpsewhich || {
fail rwx kpsewhich
$_kpseaccess r $_kpsewhich || fail r kpsewhich
$_kpseaccess w $_kpsewhich || fail w kpsewhich
$_kpseaccess x $_kpsewhich || fail x kpsewhich
./kpseaccess r kpsewhich || fail r kpsewhich
./kpseaccess w kpsewhich || fail w kpsewhich
./kpseaccess x kpsewhich || fail x kpsewhich
}

$_kpseaccess r $srcdir/access.c || exit 9
$_kpseaccess x $srcdir/access.c && pass x $srcdir/access.c
./kpseaccess r $srcdir/access.c || exit 1
./kpseaccess x $srcdir/access.c && pass x $srcdir/access.c

if $_kpseaccess w $srcdir/access.c; then
if ./kpseaccess w $srcdir/access.c; then
echo 'file "$srcdir/access.c" is writable'
else
echo 'file "$srcdir/access.c" is not writable'
Expand Down
8 changes: 2 additions & 6 deletions source/texk/kpathsea/tests/kpsereadlink.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@
# Copyright 2010 Peter Breitenlohner <[email protected]>
# You may freely use, modify and/or distribute this file.

BinDir=${BinDir:-.}
ExeExt=${ExeExt:-}
_kpsereadlink=$BinDir/kpsereadlink$ExeExt

test "x$LN_S" = 'xln -s' || exit 77

$_kpsereadlink $LT_OBJDIR/libkpathsea.lai && exit 1
./kpsereadlink $LT_OBJDIR/libkpathsea.lai && exit 1

link=`$_kpsereadlink $LT_OBJDIR/libkpathsea.la` || exit 1
link=`./kpsereadlink $LT_OBJDIR/libkpathsea.la` || exit 1

test "x$link" = x../libkpathsea.la || exit 1

0 comments on commit 32bee52

Please sign in to comment.