Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[t] Add an embed test that creates multiple interpreters
  • Loading branch information
leto committed Dec 18, 2010
1 parent 9efb857 commit 889f1c2
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion t/src/embed.t
Expand Up @@ -10,7 +10,7 @@ use File::Spec::Functions;

plan skip_all => 'src/parrot_config.o does not exist' unless -e catfile(qw/src parrot_config.o/);

plan tests => 10;
plan tests => 11;

=head1 NAME
Expand Down Expand Up @@ -64,6 +64,44 @@ CODE
Done
OUTPUT

c_output_is(linedirective(__LINE__) . <<'CODE', <<'OUTPUT', "Minimal embed, create multiple interps" );
#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, const char **argv)
{
Parrot_Interp interp1, interp2;
interp1 = Parrot_new(NULL);
if (!interp1)
fail("Cannot create 1st parrot interpreter");
interp2 = Parrot_new(interp1);
if (!interp2)
fail("Cannot create 2nd parrot interpreter");
puts("Done");
Parrot_destroy(interp1);
Parrot_destroy(interp2);
puts("Really done");
return 0;
}
CODE
Done
Really done
OUTPUT

my $common = linedirective(__LINE__) . <<'CODE';
#include <stdio.h>
#include <stdlib.h>
Expand Down

0 comments on commit 889f1c2

Please sign in to comment.