From 96fac305d02ea9a2c2edbcec7d2cf01aa4ded8e2 Mon Sep 17 00:00:00 2001 From: NotFound Date: Wed, 6 Jul 2011 22:41:09 +0200 Subject: [PATCH] minimal test of the bundled Winxed --- MANIFEST | 1 + lib/Parrot/Harness/DefaultTests.pm | 1 + t/ext/winxed/compreg.t | 50 ++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 t/ext/winxed/compreg.t diff --git a/MANIFEST b/MANIFEST index d5b1ba7556..e7bbd91e95 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1678,6 +1678,7 @@ t/examples/shootout.t [test] t/examples/streams.t [test] t/examples/subs.t [test] t/examples/tutorial.t [test] +t/ext/winxed/compreg.t [test] t/harness [test] t/harness.pir [test] t/include/fp_equality.t [test] diff --git a/lib/Parrot/Harness/DefaultTests.pm b/lib/Parrot/Harness/DefaultTests.pm index 6feea0863e..cc5997fe5d 100644 --- a/lib/Parrot/Harness/DefaultTests.pm +++ b/lib/Parrot/Harness/DefaultTests.pm @@ -89,6 +89,7 @@ our @EXPORT_OK = qw( t/dynoplibs/*.t t/dynpmc/*.t t/library/*.t + t/ext/winxed/*.t t/tools/*.t t/profiling/*.t ); diff --git a/t/ext/winxed/compreg.t b/t/ext/winxed/compreg.t new file mode 100644 index 0000000000..3f8d403793 --- /dev/null +++ b/t/ext/winxed/compreg.t @@ -0,0 +1,50 @@ +#!./parrot +# Copyright (C) 2011, Parrot Foundation. + +=head1 NAME + +t/ext/winxed/compreg.t - test winxed compreg. + +=head1 SYNOPSIS + + % prove t/ext/winxed/compreg.t + +=head1 DESCRIPTION + +Tests using winxed compreg. + +=cut + +.sub main :main + .include 'test_more.pir' + plan(2) + + .local pmc wcomp + .local int r + + load_language 'winxed' + wcomp = compreg 'winxed' + r = isnull wcomp + is(r, 0, "winxed compreg is not null") + + .local string source + .local pmc result + + source = <<'SOURCE' +function main(argv) +{ + string s = "hello"; + say(s); +} +SOURCE + + result = wcomp.'compile'(source, "pir" :named("target")) + like(result, "hello", "pir geenrated from a simple source looks good") + +.end + +# Local Variables: +# mode: pir +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4 ft=pir: