Subject: | File::HomeDir 0.64 testing fails when user has $HOME set to other than location in /etc/passwd or equivalent |
Date: | Mon, 23 Apr 2007 14:13:53 -0700 |
To: | bug-file-homedir [...] rt.cpan.org |
From: | "Jonathan Leffler" <jonathan.leffler [...] gmail.com> |
I don't know whether this is unique to File::HomeDir 0.64 (compared with any
older version), but...
On my development machines at the office, my 'official' home directory is
/u/jleffler on an NFS-mounted file system. However, I have a local
directory on each machine that I want to treat as $HOME, so my login process
does (amongst a myriad other similarly arcane things):
export REAL_HOME=$HOME
export HOME=/work1/jleffler
cd $HOME
In fact the name of the directory is controlled per-machine (and the whole
profile setup is more contorted than you'd believe possible, but it works
nicely for me across multiple machines in multiple states).
So, the tests were failing like this:
Black JL: make test
PERL_DL_NONLAZY=1 /usr/perl/v5.8.8-32bit-sun-cc/bin/perl
"-MExtUtils::Command::MM" "-e" "test_harnes
s(0, 'inc', 'blib/lib', 'blib/arch')" t/*.t
t/01_compile....ok
t/02_main.......ok 1/52
# Failed test 'home(username) returns the same value'
t/02_main.......NOK 27/52# at t/02_main.t line 205.
# got: '/u/jleffler'
# expected: '/work1/jleffler'
# Failed test 'Legacy %~ tied interface'
# at t/02_main.t line 211.
t/02_main.......NOK 29/52# got: '/u/jleffler'
# expected: '/work1/jleffler'
# Looks like you failed 2 tests of 52.
t/02_main.......dubious
Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 27, 29
Failed 2/52 tests, 96.15% okay
t/99_author.....skipped
all skipped: Author tests not required for installation
Failed Test Stat Wstat Total Fail List of Failed
-------------------------------------------------------------------------------
t/02_main.t 2 512 52 2 27 29
1 test skipped.
Failed 1/3 test scripts. 2/59 subtests failed.
Files=3, Tests=59, 1 wallclock secs ( 0.69 cusr + 0.14 csys = 0.83 CPU)
Failed 1/3 test programs. 2/59 subtests failed.
make: *** [test_dynamic] Error 29
Black JL:
When in fact, they were quite correctly determining both $HOME and
~jleffler, and (in my situation, erroneously) determining that these values
are not the same and hence that the module was mal-functioning.
I've not attempted to submit a patch because I'm not sure how you want to
regard my setup - apart, clearly, from being unusual. I should add that
I've been using this setup for a couple of decades now - setting $HOME to
the location that is convenient to regard as the base location I want to go
to when I do 'cd' with nothing else specified. And in that time, I've done
it on many machines, both obscure (and now obsolete) and still current and
mainstream (eg Solaris 10 - where I ran this test) and HP-UX, and AIX, and
...
Windows doesn't count - even though I'm writing this email on Windows.
I have simply installed the module since it is producing correct answers.
--
Jonathan Leffler <jonathan.leffler@gmail.com> #include <disclaimer.h>
Guardian of DBD::Informix - v2007.0226 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."