tcsh-org / tcsh

This is a read-only mirror of the tcsh code repository.
https://www.tcsh.org/
Other
232 stars 42 forks source link

Many tests fail when PWD includes a symlink #23

Closed jbeich closed 4 years ago

jbeich commented 4 years ago

Affects at least 11.3-RELEASE, 12.1-RELEASE and 13.0-CURRENT. Running under /tmp/tcsh works fine but not under /home/whatever/tcsh. Tested with /bin/sh and /usr/local/bin/bash as parent shell.

$ pkg install git autoconf
$ git clone https://github.com/tcsh-org/tcsh
$ cd tcsh
$ ./configure; make; make test
[...]
135: Directory stack substitution                    FAILED (subst.at:104)
158: $ cwd                                           FAILED (variables.at:234)
161: $ dirstack                                      FAILED (variables.at:267)
176: $ history                                       FAILED (variables.at:575)
179: $ implicitcd                                    FAILED (variables.at:647)
201: $ owd                                           FAILED (variables.at:764)
204: $ prompt                                        FAILED (variables.at:839)
213: $ rprompt                                       FAILED (variables.at:896)
[...]
ERROR: 181 tests were run,
8 failed unexpectedly.
54 tests were skipped.
suominen commented 4 years ago

Is /home a symlink to usr/home?

The tests do not account for the path pointed to by ${HOME} containing a symbolic link.

jbeich commented 4 years ago

Is /home a symlink to usr/home?

Correct. This is the default behavior on FreeBSD. I'm not sure where in FreeBSD source it's define though.

suominen commented 4 years ago

If I get rid of the symlink (as root):

cd /
rm home
mv usr/home .

Then all the CWD-related failures go away.

I also tried this (as myself):

/bin/sh
cd /usr/home/kim/src/tcsh
make test

This got ${PWD} in the calling shell to be the absolute path. But it doesn't make the tests succeed.

I'm not familiar enough with autotest to figure out how to make it redefine ${PWD} in its initialisation.