Skip to content
This repository
branch: non-bootstrap
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 37 lines (31 sloc) 0.814 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
#include <stdio.h>
#include <EXTERN.h>
#include <perl.h>

/* So that we can load XS using modules from our perl */
EXTERN_C void xs_init (pTHX);

EXTERN_C void boot_DynaLoader (pTHX_ CV* cv);

EXTERN_C void
xs_init(pTHX)
{
char *file = __FILE__;
dXSUB_SYS;

/* DynaLoader is a special case */
newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
}

static PerlInterpreter *my_perl;
int run_test()
{
  int argc = 1;
  char *argv0[] = { "perl", NULL, 0 };
  char **argv = argv0;
  PERL_SYS_INIT(&argc,&argv);
  my_perl = perl_alloc();
  perl_construct(my_perl);
  char *embedding[] = { "", "-e", "0" };
  perl_parse(my_perl, xs_init, 3, embedding, NULL);
  PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
  eval_pv("print \"OK 5\\n\"",TRUE);
  perl_destruct(my_perl);
  perl_free(my_perl);
  PERL_SYS_TERM();
}
Something went wrong with that request. Please try again.