2 # Copyright (C) 2001-2006, Parrot Foundation.
7 use lib qw( . lib ../lib ../../lib );
9 use Parrot::Test tests => 3;
13 t/src/basic.t - Basics
21 Tests C<printf> and C<exit_fatal> functions.
25 c_output_is( <<'CODE', <<'OUTPUT', "hello world" );
30 main(int argc, char* argv[])
32 printf("Hello, World!\n");
39 c_output_is( <<'CODE', <<'OUTPUT', "direct exit_fatal call" );
40 #include <parrot/parrot.h>
41 #include <parrot/exceptions.h>
44 main(int argc, char* argv[])
46 exit_fatal(0, "Blow'd Up(tm)"); /* ' */
54 c_output_is( <<'CODE', <<'OUTPUT', "Parrot_run_native" );
56 #include <parrot/parrot.h>
57 #include <parrot/embed.h>
59 static opcode_t *the_test(Parrot_Interp, opcode_t *, opcode_t *);
62 main(int argc, char* argv[])
66 interp = Parrot_new(NULL);
71 Parrot_io_eprintf(interp, "main\n");
73 Parrot_run_native(interp, the_test);
75 Parrot_io_eprintf(interp, "back\n");
76 Parrot_exit(interp, 0);
81 the_test(Interp *interp,
82 opcode_t *cur_op, opcode_t *start)
88 Parrot_io_eprintf(interp, "ok\n");
90 return NULL; /* always return 0 or bad things may happen */
101 # cperl-indent-level: 4
104 # vim: expandtab shiftwidth=4: