Skip to content

Commit

Permalink
CORE: version-specific coretests as submodule
Browse files Browse the repository at this point in the history
See rurban#332
Submodule stored at https://github.com/perl11/p5-coretests
initialized with t/core-init.sh

(cherry picked from commit bfc3930)
Signed-off-by: Nicolas Rochelemagne <rochelemagne@cpanel.net>
  • Loading branch information
Reini Urban authored and atoomic committed Dec 10, 2015
1 parent 1bcccc9 commit 1914787
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
the Regexp dynamically (GH #252)
* CC (1.16_01): Encode unicode labels (GH#318)
* Stackobj (1.12_01): fix Inf/NaN support for CC (GH#287)
* t/CORE: versioned the core tests and moved to a external submodule
(GH #332)

1.52 2014-09-09 rurban
* C: Protect against empty SV ptr in SV magic (\0) with $` with 5.20 (#370)
Expand Down
25 changes: 25 additions & 0 deletions t/core-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

if [ ! -f Makefile.PL -a -f ../Makefile.PL ]; then
chdir ..
fi
if [ ! -f Makefile.PL ]; then
echo wrong basedir, missing Makefile.PL
exit
fi
if [ ! -d t/CORE ]; then
if [ ! -d .git ]; then
echo git clone p5-coretests.git t/CORE
git clone https://github.com/perl11/p5-coretests.git t/CORE
else
if [ ! -f .gitmodules ]; then
echo git submodule add p5-coretests.git t/CORE
git submodule add https://github.com/perl11/p5-coretests.git t/CORE
fi
echo git submodule update --remote
git submodule update --remote
fi
else
echo git submodule update --remote
git submodule update --remote
fi
3 changes: 2 additions & 1 deletion t/coreall.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh
t=${1:-t/CORE/comp/proto.t}
# run all perls on a single core test
t=${1:-t/CORE/v5.22/comp/proto.t}
echo perlall='5.*-nt' perlall -m --nolog do $t
perlall='5.*-nt' perlall -m --nolog do $t 2>&1 | egrep '(^not ok|/perl5.)'
11 changes: 6 additions & 5 deletions t/testc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ PERL=${PERL:-perl}
PERL=`echo $PERL|sed -e's,^",,; s,"$,,'`
v510=`$PERL -e'print (($] < 5.010)?0:1)'`
v518=`$PERL -e'print (($] < 5.018)?0:1)'`
PERLV=v5.`$PERL -e'print substr($],3,2)'`
XTESTC="t/C-COMPILED/xtestc"
PERLV=$(perl -e 'print $^V')
XTESTC="t/$PERLV/C-COMPILED/xtestc"

function init {
BASE=`basename $0`
Expand Down Expand Up @@ -132,14 +132,15 @@ function make_t_symlink {
CONTENT="${tests[${n}]}"
if [ "x$CONTENT" != "x" ]; then
FILE_NUM=$(printf "%04d" $n)
FILE="$XTESTC--${FILE_NUM}.t"
unlink $FILE
ln -s testc.pl $FILE
FILE="$XTESTC/${FILE_NUM}.t"
test -e $FILE && unlink $FILE
ln -s ../testc.pl $FILE
fi
}

function make_symlinks {
MAX=9999
test -d $XTESTC || mkdir $XTESTC
rm -f $XTESTC/*.t ||:
for b in $(seq $MAX); do
make_t_symlink $b
Expand Down

0 comments on commit 1914787

Please sign in to comment.