Front page | perl.cvs.parrot |
Postings from January 2009
[svn:parrot] r35461 - in trunk: compilers/pirc/src compilers/pirc/t lib/Parrot
From:
kjs
Date:
January 12, 2009 15:46
Subject:
[svn:parrot] r35461 - in trunk: compilers/pirc/src compilers/pirc/t lib/Parrot
Message ID:
20090112234621.952A5CB9FA@x12.develooper.com
Author: kjs
Date: Mon Jan 12 15:46:20 2009
New Revision: 35461
Modified:
trunk/compilers/pirc/src/pircapi.c
trunk/compilers/pirc/src/pirop.c
trunk/compilers/pirc/t/basic.t
trunk/compilers/pirc/t/heredoc.t
trunk/compilers/pirc/t/macro.t
trunk/compilers/pirc/t/stmts.t
trunk/compilers/pirc/t/subflags.t
trunk/lib/Parrot/Test.pm
Log:
[pirc] remove all tests, and replace them currently with a placeholder. All tests must be run with -x -b options, so that PIRC tests will actually be real PBC running.
+ fix some POD errors.
[lib] change commandline options for running PIRC tests.
Modified: trunk/compilers/pirc/src/pircapi.c
==============================================================================
--- trunk/compilers/pirc/src/pircapi.c (original)
+++ trunk/compilers/pirc/src/pircapi.c Mon Jan 12 15:46:20 2009
@@ -16,6 +16,8 @@
=head1 DESCRIPTION
+This file implements the API for PIRC. A program that wants to use
+PIRC's services should use only these functions.
=head1 FUNCTIONS
Modified: trunk/compilers/pirc/src/pirop.c
==============================================================================
--- trunk/compilers/pirc/src/pirop.c (original)
+++ trunk/compilers/pirc/src/pirop.c Mon Jan 12 15:46:20 2009
@@ -13,6 +13,8 @@
=head1 DESCRIPTION
+This file contains functions related to opcodes.
+
=head1 FUNCTIONS
=over 4
Modified: trunk/compilers/pirc/t/basic.t
==============================================================================
--- trunk/compilers/pirc/t/basic.t (original)
+++ trunk/compilers/pirc/t/basic.t Mon Jan 12 15:46:20 2009
@@ -1,113 +1,18 @@
#!perl
-# Copyright (C) 2008, The Perl Foundation.
+# Copyright (C) 2008-2009, The Perl Foundation.
# $Id$
use lib "../../lib";
-use Parrot::Test tests => 10;
+use Parrot::Test tests => 1;
pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "a single const declaration");
-.const int x = 42
-CODE
-OUTPUT
-
-
-pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "a single namespace declaration");
-.namespace []
-CODE
-OUTPUT
-
-pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "multiple namespace declaration");
-.namespace ['X';'Z']
-.namespace ['A';'B']
-CODE
-OUTPUT
-
-pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "other chunks");
-.HLL "FOO"
-.HLL_map "Integer" = "Float"
-.loadlib "../../../dan_ops"
-.line 42
-.file "somefile.pir"
-CODE
-OUTPUT
-
-
-pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "test a basic :main sub");
-.sub main :main
-.end
-CODE
-.namespace []
-.pcc_sub :main main:
- end
-OUTPUT
-
-pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "test a normal basic sub");
.sub main
+ say "ok"
.end
CODE
-.namespace []
-main:
- set_returns 1
- returncc
+ok
OUTPUT
-
-pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "test sub with sub pragmas");
-.sub main :load :init :immediate :postcomp :anon :multi()
-.end
-CODE
-.namespace []
-.pcc_sub main:
- set_returns 1
- returncc
-OUTPUT
-
-pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "test sub with vtable pragma");
-.sub main :vtable("get_integer")
-.end
-
-.sub get_integer :vtable
-.end
-CODE
-.namespace []
-.pcc_sub main:
- set_returns 1
- returncc
-.namespace []
-.pcc_sub get_integer:
- set_returns 5
- returncc
-OUTPUT
-
-pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "test sub with method pragma");
-.sub main :method("hello")
-.end
-
-.sub bye :method
-.end
-CODE
-.namespace []
-.pcc_sub :method main:
- set_returns 1
- returncc
-.namespace []
-.pcc_sub :method bye:
- set_returns 5
- returncc
-OUTPUT
-
-pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "test sub with :subid");
-.sub main :subid("foo")
-.end
-
-CODE
-.namespace []
-.pcc_sub main:
- set_returns 1
- returncc
-OUTPUT
-
-
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
Modified: trunk/compilers/pirc/t/heredoc.t
==============================================================================
--- trunk/compilers/pirc/t/heredoc.t (original)
+++ trunk/compilers/pirc/t/heredoc.t Mon Jan 12 15:46:20 2009
@@ -1,82 +1,16 @@
#!perl
-# Copyright (C) 2008, The Perl Foundation.
+# Copyright (C) 2008-2009, The Perl Foundation.
# $Id$
-
use lib "../../lib";
-use Parrot::Test tests => 3;
-
-
-pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "heredoc test");
-.sub main
- foo(<<'A', <<'B', <<'HI')
-this is a simple single-line heredoc.
-A
-this is a simple
-multi
-line
-heredoc
-.
-B
-and yet another
-multi
-line
-heredoc
-string.
-HI
-
-.end
-CODE
-.namespace []
-main:
- set_args 1
- get_results 2
- find_sub_not_null P0, "foo"
- invokecc P0
- set_returns 3
- returncc
-OUTPUT
-
-pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "more heredoc");
-.sub foo
- .param pmc args :slurpy
-
- .yield(<<'YIELD')
- This is some text returned through .yield!
-
-YIELD
-
- .return(<<'RET')
- Some text returned through return
-RET
-.end
-CODE
-.namespace []
-foo:
- get_params
- set_returns 1
- yield
- set_returns 2
- returncc
-OUTPUT
+use Parrot::Test tests => 1;
-pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "heredoc string assignment");
+pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "a single const declaration");
.sub main
- $S0 = <<'A'
-this is a simple assigned heredoc string to $S0.
-A
- .local string s
- s = <<'B'
-this is a simple assigned heredoc string to string s.
-B
+ say "ok"
.end
CODE
-.namespace []
-main:
- set S0, "\nthis is a simple assigned heredoc string to $S0.\n"
- set S1, "\nthis is a simple assigned heredoc string to string s.\n"
- set_returns 1
- returncc
+ok
OUTPUT
# Local Variables:
Modified: trunk/compilers/pirc/t/macro.t
==============================================================================
--- trunk/compilers/pirc/t/macro.t (original)
+++ trunk/compilers/pirc/t/macro.t Mon Jan 12 15:46:20 2009
@@ -1,45 +1,16 @@
#!perl
-# Copyright (C) 2008, The Perl Foundation.
+# Copyright (C) 2008-2009, The Perl Foundation.
# $Id$
use lib "../../lib";
-use Parrot::Test tests => 2;
-
-
-pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "simple macro without parameters");
-.macro Hi()
- print "hello"
-.endm
-.sub main
- .Hi()
-.end
-CODE
-.namespace []
-main:
- print "hello"
- set_returns 1
- returncc
-OUTPUT
-
-pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "expansion w/ parameters and nested macro_const expansion");
-.macro_const ANSWER 42
-
-.macro foo(a,b)
- say .a
- say .b
-.endm
+use Parrot::Test tests => 1;
+pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "a single const declaration");
.sub main
- .foo(.ANSWER, "hi")
+ say "ok"
.end
-
CODE
-.namespace []
-main:
- say 42
- say "hi"
- set_returns 1
- returncc
+ok
OUTPUT
# Local Variables:
@@ -48,4 +19,3 @@
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4:
-
Modified: trunk/compilers/pirc/t/stmts.t
==============================================================================
--- trunk/compilers/pirc/t/stmts.t (original)
+++ trunk/compilers/pirc/t/stmts.t Mon Jan 12 15:46:20 2009
@@ -1,180 +1,18 @@
#!perl
-# Copyright (C) 2008, The Perl Foundation.
+# Copyright (C) 2008-2009, The Perl Foundation.
# $Id$
use lib "../../lib";
-use Parrot::Test tests => 5;
+use Parrot::Test tests => 1;
-pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "assignments");
+pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "a single const declaration");
.sub main
- .local pmc x, y, z
- .local string a, b, c
- .local int i, j
- .local num pi
- x = 1
- a = "hi"
- i = 42
- pi = 3.14
+ say "ok"
.end
CODE
-.namespace []
-main:
- set P0, 1
- set S0, "hi"
- set I0, 42
- set N0, 3.140000
- set_returns 1
- returncc
+ok
OUTPUT
-
-pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "if statement");
-.sub main
- .local int x, y, z
- if x < y goto X
- unless y > x goto Y
-X:
-Y:
-Z:
-.end
-CODE
-.namespace []
-main:
- lt I0, I1, 8
- le I1, I0, 4
-X:
-Y:
-Z:
- set_returns 1
- returncc
-OUTPUT
-
-
-
-pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "if statement with keywords");
-.sub int
- .local int if, int, goto
- .local pmc pmc, null
- if int > if goto goto
- if int > if goto L
-goto:
-L:
-.end
-CODE
-.namespace []
-int:
- lt I1, I0, 8
- lt I1, I0, 4
-goto:
-L:
- set_returns 1
- returncc
-OUTPUT
-
-
-
-pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "sub call not in this compilation unit");
-.sub main
- foo()
-.end
-CODE
-.namespace []
-main:
- set_args 1
- get_results 2
- find_sub_not_null P0, "foo"
- invokecc P0
- set_returns 3
- returncc
-OUTPUT
-
-
-
-pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "sub call in this compilation unit");
-.sub main
- foo()
-.end
-.sub foo
-.end
-CODE
-.namespace []
-main:
- set_args 1
- get_results 2
- set P0, 10
- invokecc P0
- set_returns 3
- returncc
-.namespace []
-foo:
- set_returns 7
- returncc
-OUTPUT
-
-
-##
-### test return statements
-## .return (1)
-## .return (x :flat)
-## .return (x :named('z'))
-## .return (a, b, c)
-## .return (a :flat, b, c :flat :named)
-##
-### test yield statements
-##
-## .yield (1)
-## .yield (a :flat)
-## .yield (x :named)
-## .yield (b :named('b'))
-## .yield (d, e, f)
-##.end
-###
-### comments
-##.sub foo
-## .param pmc args :slurpy
-## .local int i
-## i = args[0]
-## print i
-##
-### test long return statement
-## .begin_return
-## .end_return
-##
-## .begin_return
-## .return p :flat :named('myP')
-## .end_return
-##
-### test long yield statement
-## .begin_yield
-## .end_yield
-##
-## .begin_yield
-## .return q :flat
-## .return r :named('myR')
-## .return s :flat :named
-## .end_yield
-##
-## x = null
-## null x
-##
-### test long subcall
-## .begin_call
-## .call Y
-## .end_call
-##
-## .begin_call
-## .arg y :flat
-## .arg z :named('z')
-## .call Z
-## .result P0 :slurpy
-## .local pmc x
-## .result x
-## .end_call
-##
-##
-##.end
-
-
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
Modified: trunk/compilers/pirc/t/subflags.t
==============================================================================
--- trunk/compilers/pirc/t/subflags.t (original)
+++ trunk/compilers/pirc/t/subflags.t Mon Jan 12 15:46:20 2009
@@ -1,21 +1,18 @@
#!perl
-# Copyright (C) 2008, The Perl Foundation.
+# Copyright (C) 2008-2009, The Perl Foundation.
# $Id$
-
use lib "../../lib";
use Parrot::Test tests => 1;
-pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "test for :main");
-.sub main :main
+pirc_2_pasm_is(<<'CODE', <<'OUTPUT', "a single const declaration");
+.sub main
+ say "ok"
.end
CODE
-.namespace []
-.pcc_sub :main main:
- end
+ok
OUTPUT
-
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
Modified: trunk/lib/Parrot/Test.pm
==============================================================================
--- trunk/lib/Parrot/Test.pm (original)
+++ trunk/lib/Parrot/Test.pm Mon Jan 12 15:46:20 2009
@@ -740,7 +740,7 @@
$args =~ s/--run-exec//;
$cmd = qq{$parrot $args "$code_f"};
} elsif ($func =~ /^pirc_/) {
- $cmd = qq{$pirc -p "$code_f"};
+ $cmd = qq{$pirc -b -x "$code_f"};
}
write_code_to_file( $code, $code_f );
-
[svn:parrot] r35461 - in trunk: compilers/pirc/src compilers/pirc/t lib/Parrot
by kjs