Given Leo's new scheme for C code tests, I suggest that we add a header to be included in the test, and modify Parrot::Test so that it knows to add the header's location to the command.

This patch puts the header in parrot/t/c_test_header.h.

The correct scheme for a C test can now be:

c_output_is(<<'CODE', <<'OUTPUT', "C code test");
#include "c_test_header.h"
int do_test(Interp *interpreter)
{
        ...
}
CODE
...
OUTPUT


Attachment: c_test_header.h
Description: application/applefile

#include <stdio.h>
#include "parrot/parrot.h"
#include "parrot/embed.h"

int do_test(Interp *interpreter);

int main(int argc, char* argv[]) {
    Interp* interpreter;
    interpreter = Parrot_new();

    if ( interpreter == NULL ) return 1;
    interpreter->lo_var_ptr = &interpreter;

    Parrot_init(interpreter);
    return do_test(interpreter);
}

Attachment: Test.pm
Description: application/text


Reply via email to