mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 05:25:58 +08:00
Unit test to verify whether Slic3r would hang when croaking from
a C++ exception handler. This is an unfortunate error in some Strawberry Perl distributions. Conflicts: xs/xsp/XS.xsp
This commit is contained in:
parent
8910b4970a
commit
1e37195af1
@ -121,6 +121,7 @@ t/18_motionplanner.t
|
|||||||
t/19_model.t
|
t/19_model.t
|
||||||
t/20_print.t
|
t/20_print.t
|
||||||
t/21_gcode.t
|
t/21_gcode.t
|
||||||
|
t/22_exception.t
|
||||||
xsp/BoundingBox.xsp
|
xsp/BoundingBox.xsp
|
||||||
xsp/BridgeDetector.xsp
|
xsp/BridgeDetector.xsp
|
||||||
xsp/Clipper.xsp
|
xsp/Clipper.xsp
|
||||||
|
16
xs/t/22_exception.t
Normal file
16
xs/t/22_exception.t
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
use Slic3r::XS;
|
||||||
|
use Test::More tests => 1;
|
||||||
|
|
||||||
|
{
|
||||||
|
eval {
|
||||||
|
Slic3r::xspp_test_croak_hangs_on_strawberry();
|
||||||
|
};
|
||||||
|
is $@, "xspp_test_croak_hangs_on_strawberry: exception catched\n", 'croak from inside a C++ exception delivered';
|
||||||
|
}
|
||||||
|
|
||||||
|
__END__
|
@ -16,4 +16,24 @@ VERSION()
|
|||||||
RETVAL = newSVpv(SLIC3R_VERSION, 0);
|
RETVAL = newSVpv(SLIC3R_VERSION, 0);
|
||||||
OUTPUT: RETVAL
|
OUTPUT: RETVAL
|
||||||
|
|
||||||
|
SV*
|
||||||
|
DEBUG_OUT_PATH_PREFIX()
|
||||||
|
CODE:
|
||||||
|
RETVAL = newSVpv(SLIC3R_DEBUG_OUT_PATH_PREFIX, 0);
|
||||||
|
OUTPUT: RETVAL
|
||||||
|
|
||||||
|
SV*
|
||||||
|
FORK_NAME()
|
||||||
|
CODE:
|
||||||
|
RETVAL = newSVpv(SLIC3R_FORK_NAME, 0);
|
||||||
|
OUTPUT: RETVAL
|
||||||
|
|
||||||
|
void
|
||||||
|
xspp_test_croak_hangs_on_strawberry()
|
||||||
|
CODE:
|
||||||
|
try {
|
||||||
|
throw 1;
|
||||||
|
} catch (...) {
|
||||||
|
croak("xspp_test_croak_hangs_on_strawberry: exception catched\n");
|
||||||
|
}
|
||||||
%}
|
%}
|
Loading…
x
Reference in New Issue
Block a user