Testing perl after installing it

When you create perl from the source code, you have the option to run make testperl at the final destination before installing it.

Is it possible to execute the equivalent make testafter installing perl?

Please note that I will not have the source source. I would like to download the source tarball for the same version of perl that I installed, and then run the tests (from the source tarball) against the installed perl.

Possible / Impossible? Easy hard? How can i do this?

+5
source share
3 answers
  • Maybe.
  • Hard
  • Not worth it.

Perl Perl , , , , Perl. " ", , , Perl. , , " ", makefile.

? Perl, . , , . ; Perl, . , 5.10.0, 5.10.1, 5.12.1, 5.14.0 5.14.1 ( ) , . 5.8.x, .

, , Perl, . Perl, ( ).

+2

, ( Configure make), , :

/path/to/src/distribution/lib'. The key to running your existing perl installation against this test suite is to put all of the install libraries into this lib`. :

cd /path/to/src/distribution
mv lib lib-original
mkdir lib
/path/to/installed/perl -e 'system qq{cp -prv "$_/." lib/}' \
        -e 'for "lib-original",grep /../,reverse(@INC)'

(, perl, -MFile::Copy, ). reverse @INC, @INC , . grep /../,... . lib, , , .

, perl, psed s2p . , .

rm -f perl t/perl psed t/psed x2p/s2p
ln -s /path/to/installed/perl perl
ln -s /path/to/installed/perl t/perl
ln -s /path/to/installed/psed psed
ln -s /path/to/installed/psed t/psed
ln -s /path/to/installed/s2p x2p/s2p

Unix-y Perl:

cd t
/path/to/installed/perl -MExtUtils::Command::MM \
        -e 'test_harness(0,"../lib")' */*.t

build-from-source, .

( v5.14.0, v5.8.9, v5.10.1)

: . t . , :

cd /path/to/source/distribution

for dir in */*/
do
        if [ -d $dir/t ] ; then
            pushd $dir
            echo Testing $dir
            /path/to/installed/perl -MExtUtils::Command::MM \
                    -e 'test_harness(0,"../../lib","lib")' t/*.t
            popd
        fi
done

, , .

+2

t/TEST perl.

:

  • "#!./perl" she-bang

  • 142 chdir t.

, perl, "t" perl core ( ).

.

Another way is to create a list of all installed files when doing make install (make it install perl in a temporary directory and then run ls -lR in that directory to view the list), and then copy those files from the installed perl to your source perl directory

Using a version control system (e.g. git) can help here so you can easily revert to the original versions of any files that you could rewrite along the way.

+1
source

All Articles