[perl #47940] [CAGE] mk_native_pbc stale

Reini Urban via RT parrotbug-followup at parrotcode.org
Mon Feb 9 11:45:21 UTC 2009


Attached is my current working version. 
Still as sh version, not converted to perl.

docs/project/release_manager_guide.pod updates missing

Please review.
-- 
Reini Urban
-------------- next part --------------
Index: tools/dev/mk_native_pbc
===================================================================
--- tools/dev/mk_native_pbc	(revision 36480)
+++ tools/dev/mk_native_pbc	(working copy)
@@ -1,32 +1,130 @@
 #!/bin/sh
 
-# generate t/native_pbc_{1,2}.pbc
-# this should be run on i386 systems to regenerate the first two
-# native tests
-# NOTE: This will need a perl compiled with long double support
+# generate t/native_pbc/_{1,2}.pbc
+# This should only be run on known systems to regenerate the native pbcs.
+# Better do not try that on mingw, use cygwin instead.
+#
+# NOTE:  For _2 this will need a perl compiled with long double support
 # NOTE2: Installing ccache speeds this process up considerably
+# NOTE3: Do not svn commit this on a devel release,
+#        update the VERSION and rm .parrot_current_rev
 
+#  _1   i386 32 bit opcode_t, 32 bit intval   (linux-gcc-ix86, freebsd-gcc, cygwin)
+#  _2   i386 32 bit opcode_t, 32 bit intval, long double (linux-gcc-ix86)
+#  _3   PPC BE 32 bit opcode_t, 32 bit intval (darwin-ppc)
+#  _4   x86_64 double float 64 bit opcode_t   (linux-gcc-x86_64, solaris-cc-64int)
+#  _5   big-endian 64-bit                     (irix or similar)
+
+#tests:
+#parrot -o i.pbc -a - <<EOF
+#  print 0x10203040
+#  end
+#  EOF
+# t/op/number_1.pasm
+# t/op/string_133.pasm
+
 # run it as:
 # $ sh tools/dev/mk_native_pbc
 
-make -s progclean
-make -s -C imcc clean
-perl Configure.pl --debugging --floatval="long double" --nomanicheck
-tail myconfig
-make -s
-./parrot -o n.pbc t/op/number_1.pasm
-mv n.pbc t/native_pbc/number_2.pbc
+# check 32/64 bit, endianess, hugefloat
+N=
+enable_long_double=
+conf=
+exe=
 
-make -s progclean
-make -s -C imcc clean
-perl Configure.pl --debugging --floatval=double --nomanicheck
+# unfortunately there are older perls around
+byteorder=$(perl -V:byteorder | perl -ne "s/byteorder='(\d+)';/\\1/; print")
+ptrsize=$(perl -V:ptrsize)
+
+if [ "$ptrsize" == "ptrsize='4';" ]
+then
+    if [ "$byteorder" == "1234" ]
+    then
+        N=1
+        if [ "$(perl -V:uselongdouble)" == "uselongdouble='define';" ]; then
+            enable_long_double=1
+            conf=" --floatval=double"
+        fi
+    else
+        if [ "$byteorder" == "4321" ]
+        then
+            N=3
+        else
+            if [ "$byteorder" == "12345678" \
+                 -a "$(perl -V:osname)" == "osname='cygwin';" ]
+            then
+                echo "detected cygwin use64bitint: ok"
+                N=1
+                exe=.exe
+            else
+                echo "unsupported perl -V:byteorder $byteorder"
+                exit 1
+            fi
+        fi
+    fi
+else
+    if [ "$ptrsize" == "ptrsize='8';" ]
+    then
+        if [ "$byteorder" == "12345678" ]
+        then
+            N=4
+        else
+            N=5
+        fi
+    else
+        echo "unsupported perl -V:ptrsize $ptrsize"
+        exit 1
+    fi
+fi
+
+if [ "$enable_long_double" == "1" ]; then
+    make -s prog-clean
+    perl Configure.pl --debugging --floatval="long double" --nomanicheck
+    tail myconfig
+    make -s || exit 1
+    [ -e t/op/number_1.pasm ] || perl t/harness t/op/number.t
+    [ -e t/op/string_133.pasm ] || perl t/harness t/op/string.t
+    ./parrot -o t/native_pbc/integer_2.pbc -a - <<EOF
+print 0x10203040
+end
+EOF
+[ $? -le 0 ] && echo "t/native_pbc/integer_2.pbc updated"
+./parrot -o t/native_pbc/number_2.pbc t/op/number_1.pasm && echo "t/native_pbc/number_2.pbc updated"
+./parrot -o t/native_pbc/string_2.pbc t/op/string_133.pasm  && echo "t/native_pbc/string_2.pbc updated"
+
+    make pbc_dump$exe
+    ./pbc_dump -h t/native_pbc/number_2.pbc
+fi
+
+if [ "$1" != "--noconf" ]; then
+    make -s prog-clean
+    perl Configure.pl --debugging $conf --nomanicheck
+fi
 tail myconfig
-make -s
-./parrot -o n.pbc t/op/number_1.pasm
-mv n.pbc t/native_pbc/number_1.pbc
+make -s || exit 1
 
-make pbc_dump
-./pbc_dump -h t/native_pbc/number_1.pbc
-./pbc_dump -h t/native_pbc/number_2.pbc
+[ -e t/op/number_1.pasm ] || perl t/harness t/op/number.t
+[ -e t/op/string_133.pasm ] || perl t/harness t/op/string.t
+./parrot -o t/native_pbc/integer_${N}.pbc -a - <<EOF
+print 0x10203040
+end
+EOF
+[ $? -le 0 ] && echo "t/native_pbc/integer_${N}.pbc updated"
+./parrot -o t/native_pbc/number_${N}.pbc t/op/number_1.pasm && echo "t/native_pbc/number_${N}.pbc updated"
+./parrot -o t/native_pbc/string_${N}.pbc t/op/string_133.pasm  && echo "t/native_pbc/string_${N}.pbc updated"
 
-perl t/harness t/native_pbc/number.t
+make pbc_dump$exe
+./pbc_dump -h t/native_pbc/number_${N}.pbc
+
+perl t/harness t/native_pbc/integer.t && \
+    perl t/harness t/native_pbc/number.t && \
+    perl t/harness t/native_pbc/string.t
+
+echo ""
+if [ -e .parrot_current_rev ]
+then
+    echo "Do not commit these native_pbcs on devel versions, it must be a release candidate!"
+else
+    cd t/native_pbc
+    echo svn commit -m'native_pbc platform updates'
+fi
Index: t/native_pbc/integer.t
===================================================================
--- t/native_pbc/integer.t	(revision 36480)
+++ t/native_pbc/integer.t	(working copy)
@@ -8,7 +8,7 @@
 use Test::More;
 use Parrot::Config;
 
-use Parrot::Test tests => 3;
+use Parrot::Test tests => 4;
 
 =head1 NAME
 
@@ -22,11 +22,25 @@
 
 Tests word-size/float-type/endian-ness for different architectures.
 
+These tests usually only work on releases, not on svn checkouts
+and if every release has updated native pbc test files.
+
+See F<tools/dev/mk_native_pbc> to create the platform-specific native pbcs.
+
+=head1 PLATFORMS
+
+  _1   i386 32 bit opcode_t, 32 bit intval   (linux-gcc-ix86, freebsd-gcc, cygwin)
+  _2   i386 32 bit opcode_t, 32 bit intval, long double (linux-gcc-ix86)
+  _3   PPC BE 32 bit opcode_t, 32 bit intval (darwin-ppc)
+  _4   x86_64 double float 64 bit opcode_t   (linux-gcc-x86_64, solaris-cc-64int)
+  _5   big-endian 64-bit                     (irix or similar)
+
 =cut
 
 =begin comment
 
-See t/native_pbc/number.t for additional comments
+See t/native_pbc/number.t for additional comments.
+See tools/dev/mk_native_pbc to create the platform-specific native pbcs.
 
 Test files on different architectures are generated by:
 
@@ -63,12 +77,23 @@
 #         dirformat = 1
 # ]
 TODO: {
-local $TODO = "Known problem on 64bit with reading 32bit dirs. See TT #254"
-  if $PConfig{ptrsize} == 8;
+    local $TODO;
+    if ($PConfig{ptrsize} == 8) {
+        $TODO = "Known problem on 64bit with reading 32bit dirs. See TT #254"
+    } elsif ($PConfig{DEVEL}) {
+        $TODO = "devel versions are not guaranteed to succeed";
+    }
 
 pbc_output_is( undef, '270544960', "i386 32 bit opcode_t, 32 bit intval" )
     or diag "May need to regenerate t/native_pbc/integer_1.pbc; read test file";
+}
 
+TODO: {
+local $TODO = "devel versions are not guaranteed to succeed"
+  if $PConfig{DEVEL};
+pbc_output_is( undef, '270544960', "i386 32 bit opcode_t, 32 bit intval long double" )
+    or diag "May need to regenerate t/native_pbc/integer_2.pbc; read test file";
+
 # darwin/ppc:
 # HEADER => [
 #         wordsize  = 4   (interpreter's wordsize/INTVAL = 4/4)
@@ -79,9 +104,9 @@
 #         no endianize, no opcode, no numval transform
 #         dirformat = 1
 # ]
+
 pbc_output_is(undef, '270544960', "PPC BE 32 bit opcode_t, 32 bit intval")
-    or diag "May need to regenerate t/native_pbc/integer_2.pbc; read test file";
-}
+    or diag "May need to regenerate t/native_pbc/integer_3.pbc; read test file";
 
 # any ordinary 64-bit intel unix:
 # HEADER => [
@@ -93,13 +118,16 @@
 #         no endianize, no opcode, no numval transform
 #         dirformat = 1
 # ]
-pbc_output_is( undef, '270544960', "x86_64 double float 64 bit opcode_t" )
-    or diag "May need to regenerate t/native_pbc/integer_3.pbc; read test file";
 
+pbc_output_is(undef, '270544960', "i86_64 LE 64 bit opcode_t, 64 bit intval")
+    or diag "May need to regenerate t/native_pbc/integer_4.pbc; read test file";
+
 # Formerly following tests had been set up:
-# pbc_output_is(undef, '270544960', "little-endian 64-bit tru64");
-# pbc_output_is(undef, '270544960', "big-endian 64-bit irix");
+# pbc_output_is(undef, '270544960', "big-endian 64-bit (irix)");
+#    or diag "May need to regenerate t/native_pbc/integer_5.pbc; read test file";
 
+}
+
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
Index: t/native_pbc/number.t
===================================================================
--- t/native_pbc/number.t	(revision 36480)
+++ t/native_pbc/number.t	(working copy)
@@ -8,7 +8,7 @@
 use Test::More;
 use Parrot::Config;
 
-use Parrot::Test skip_all => "Ongoing work in TT #254";
+use Parrot::Test tests => 4;
 
 =head1 NAME
 
@@ -22,6 +22,19 @@
 
 Tests word-size/float-type/endian-ness for different architectures.
 
+These tests usually only work on releases, not on svn checkouts
+and if every release has updated native pbc test files.
+
+See F<tools/dev/mk_native_pbc> to create the platform-specific native pbcs.
+
+=head1 PLATFORMS
+
+  _1   i386 32 bit opcode_t, 32 bit intval   (linux-gcc-ix86, freebsd-gcc, cygwin)
+  _2   i386 32 bit opcode_t, 32 bit intval, long double (linux-gcc-ix86)
+  _3   PPC BE 32 bit opcode_t, 32 bit intval (darwin-ppc)
+  _4   x86_64 double float 64 bit opcode_t   (linux-gcc-x86_64, solaris-cc-64int)
+  _5   big-endian 64-bit                     (irix or similar)
+
 =cut
 
 =begin comment
@@ -93,12 +106,21 @@
 #         dirformat = 1
 # ]
 TODO: {
-local $TODO = "Known problem on 64bit with reading 32bit dirs. See TT #254"
-  if $PConfig{ptrsize} == 8;
+    local $TODO;
+    if ($PConfig{ptrsize} == 8) {
+        $TODO = "Known problem on 64bit with reading 32bit dirs. See TT #254"
+    } elsif ($PConfig{DEVEL}) {
+        $TODO = "devel versions are not guaranteed to succeed";
+    }
 
 pbc_output_is( undef, $output, "i386 double float 32 bit opcode_t" )
     or diag "May need to regenerate t/native_pbc/number_1.pbc; read test file";
 
+pbc_output_is( undef, $output, "i386 long double float 32 bit opcode_t")
+    or diag "May need to regenerate t/native_pbc/number_2.pbc; read test file";
+
+}
+
 # darwin/ppc:
 # HEADER => [
 #         wordsize  = 4   (interpreter's wordsize/INTVAL = 4/4)
@@ -109,9 +131,13 @@
 #         no endianize, no opcode, no numval transform
 #         dirformat = 1
 # ]
+
+TODO: {
+local $TODO = "devel versions are not guaranteed to succeed"
+  if $PConfig{DEVEL};
+
 pbc_output_is(undef, $output, "PPC double float 32 bit BE opcode_t")
-    or diag "May need to regenerate t/native_pbc/number_2.pbc; read test file";
-}
+    or diag "May need to regenerate t/native_pbc/number_3.pbc; read test file";
 
 # any ordinary 64-bit intel unix:
 # HEADER => [
@@ -123,19 +149,16 @@
 #         no endianize, no opcode, no numval transform
 #         dirformat = 1
 # ]
-TODO: {
-local $TODO = "Known problem on 64bit double-float gentoo-amd64, but not solaris-64int. See TT #254"
-  if $PConfig{ptrsize} == 8;
 
-pbc_output_is(undef, $output, "x86_64 double float 64 bit opcode_t")
-    or diag "May need to regenerate t/native_pbc/number_3.pbc; read test file";
+pbc_output_is(undef, $output, "i86_64 LE 64 bit opcode_t, 64 bit intval")
+    or diag "May need to regenerate t/native_pbc/number_4.pbc; read test file";
+
+# Formerly there were also a test for:
+# pbc_output_is(undef, $output, "big-endian 64-bit irix")
+#   or diag "May need to regenerate t/native_pbc/number_5.pbc; read test file";
+
 }
 
-# Formerly there were tests for:
-# pbc_output_is(undef, <<OUTPUT, "i386 long double float 32 bit opcode_t"); #_2
-# pbc_output_is(undef, <<OUTPUT, "little-endian 64-bit tru64");             #_4
-# pbc_output_is(undef, <<OUTPUT, "big-endian 64-bit irix");                 #_5
-
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
Index: t/native_pbc/string.t
===================================================================
--- t/native_pbc/string.t	(revision 36480)
+++ t/native_pbc/string.t	(working copy)
@@ -6,8 +6,10 @@
 use warnings;
 use lib qw( . lib ../lib ../../lib );
 use Test::More;
-use Parrot::Test skip_all => 'ongoing PBC format changes'; # tests => 1;
+use Parrot::Config;
 
+use Parrot::Test tests => 1;
+
 =head1 NAME
 
 t/native_pbc/string.t - PBC string tests
@@ -20,6 +22,19 @@
 
 Tests word-size/string/endian-ness for different architectures.
 
+These tests usually only work on releases, not on svn checkouts
+and if every release has updated native pbc test files.
+
+See F<tools/dev/mk_native_pbc> to create the platform-specific native pbcs.
+
+=head1 PLATFORMS
+
+  _1   i386 32 bit opcode_t, 32 bit intval   (linux-gcc-ix86, freebsd-gcc, cygwin)
+  _2   i386 32 bit opcode_t, 32 bit intval, long double (linux-gcc-ix86)
+  _3   PPC BE 32 bit opcode_t, 32 bit intval (darwin-ppc)
+  _4   x86_64 double float 64 bit opcode_t   (linux-gcc-x86_64, solaris-cc-64int)
+  _5   big-endian 64-bit                     (irix or similar)
+
 =cut
 
 =begin comment
@@ -49,8 +64,14 @@
 #         no endianize, no opcode, no numval transform
 #         dirformat = 1
 # ]
+TODO: {
+local $TODO = "devel versions are not guaranteed to succeed"
+  if $PConfig{DEVEL};
+
 pbc_output_is( undef, $output, "i386 32 bit opcode_t, 32 bit intval" );
 
+}
+
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4


More information about the parrot-dev mailing list