[svn:parrot] r36728 - trunk/t/src

NotFound at svn.parrot.org NotFound at svn.parrot.org
Sat Feb 14 15:31:09 UTC 2009


Author: NotFound
Date: Sat Feb 14 15:31:08 2009
New Revision: 36728
URL: https://trac.parrot.org/parrot/changeset/36728

Log:
[test] embed.h without extend.h

Modified:
   trunk/t/src/embed.t

Modified: trunk/t/src/embed.t
==============================================================================
--- trunk/t/src/embed.t	Sat Feb 14 13:32:04 2009	(r36727)
+++ trunk/t/src/embed.t	Sat Feb 14 15:31:08 2009	(r36728)
@@ -8,7 +8,7 @@
 use Test::More;
 use Parrot::Test;
 
-plan tests => 2;
+plan tests => 3;
 
 =head1 NAME
 
@@ -24,6 +24,39 @@
 
 =cut
 
+c_output_is( <<'CODE', <<'OUTPUT', "Minimal embed, using just the embed.h header" );
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "parrot/embed.h"
+
+void fail(const char *msg);
+
+void fail(const char *msg)
+{
+    fprintf(stderr, "failed: %s\n", msg);
+    exit(EXIT_FAILURE);
+}
+
+int main(int argc, char **argv)
+{
+    Parrot_Interp interp;
+    interp = Parrot_new(NULL);
+    if (! interp)
+        fail("Cannot create parrot interpreter");
+
+    if (argc)
+      Parrot_set_executable_name(interp, argv [0]);
+
+    puts("Done");
+    Parrot_exit(interp, 0);
+    return 0;
+}
+CODE
+Done
+OUTPUT
+
 c_output_is( <<'CODE', <<'OUTPUT', "Hello world" );
 
 #include <stdio.h>


More information about the parrot-commits mailing list