This testsuite test, when it fails to compile the module, puts the error on stderr. How do I make it catch the module compile error?
350: ++++++++++ ++++++++++ +++++++++- ++++++++++ +++++++testsuite_test.pmod:17:Bad argument 2 to `!=. testsuite_test.pmod:17:Expected: function(int | float, int | float, int | float ... : int(0..1)) | function((0=string | mapping | multiset | array), 0, 0 ... : int(0..1)) | function(object | program | function, mixed, mixed ... : int(0..1)) | function(mixed, object | program | function, mixed ... : int(0..1)) | function(type(mixed), type(mixed), program | function | type(mixed) ... : int(0..1)) testsuite_test.pmod:17:Got : function(int, string : void | mixed) +++
| test_any([[ | Stdio.write_file("testsuite_test.pmod", | #" ... | ext!="" && ext[0]!="#") // note the type error | "); | | // Compilation handler that hides compilation errors. | class handler | { | void compile_error(string file, int line, string err) | { | // werror("file: %O, line: %O, err: %O\n", file, line, err); | } | }; | | // turn this on when the bug is found | // master()->set_inhibit_compile_errors(lambda(){}); | | //_optimizer_debug(2); | //_assembler_debug(20); | | object orig_master = master(); | replace_master(object_program(orig_master)()); | catch { | compile_string("import ".";\n" | "int foo() { testsuite_test.efoo; }\n", | "testsuite_test", handler()); | }; | replace_master(orig_master); | return 0; | ]],0);
Perhaps the handler isn't propagated correctly when the module is compiled?
/ Martin Stjernholm, Roxen IS
Previous text:
2003-10-13 09:54: Subject: stderr error
This testsuite test, when it fails to compile the module, puts the error on stderr. How do I make it catch the module compile error?
350: ++++++++++ ++++++++++ +++++++++- ++++++++++ +++++++testsuite_test.pmod:17:Bad argument 2 to `!=. testsuite_test.pmod:17:Expected: function(int | float, int | float, int | float ... : int(0..1)) | function((0=string | mapping | multiset | array), 0, 0 ... : int(0..1)) | function(object | program | function, mixed, mixed ... : int(0..1)) | function(mixed, object | program | function, mixed ... : int(0..1)) | function(type(mixed), type(mixed), program | function | type(mixed) ... : int(0..1)) testsuite_test.pmod:17:Got : function(int, string : void | mixed) +++
| test_any([[ | Stdio.write_file("testsuite_test.pmod", | #" ... | ext!="" && ext[0]!="#") // note the type error | "); | | // Compilation handler that hides compilation errors. | class handler | { | void compile_error(string file, int line, string err) | { | // werror("file: %O, line: %O, err: %O\n", file, line, err); | } | }; | | // turn this on when the bug is found | // master()->set_inhibit_compile_errors(lambda(){}); | | //_optimizer_debug(2); | //_assembler_debug(20); | | object orig_master = master(); | replace_master(object_program(orig_master)()); | catch { | compile_string("import ".";\n" | "int foo() { testsuite_test.efoo; }\n", | "testsuite_test", handler()); | }; | replace_master(orig_master); | return 0; | ]],0);
/ Mirar
I think it should propagate the handler, and afaik it tries to do that too. But it still caches all modules in the same cache regardless of the handler they've been compiled with. That's completely bogus and ought to be fixed.
/ Martin Stjernholm, Roxen IS
Previous text:
2003-10-13 13:32: Subject: stderr error
That might be the case. Should it be, or should the master have a special handler for compiling modules?
/ Mirar
Yes, please. :)
/ Mirar
Previous text:
2003-10-13 20:25: Subject: stderr error
I think it should propagate the handler, and afaik it tries to do that too. But it still caches all modules in the same cache regardless of the handler they've been compiled with. That's completely bogus and ought to be fixed.
/ Martin Stjernholm, Roxen IS
pike-devel@lists.lysator.liu.se