4 # without this the stacktrace of $schema will be activated
5 BEGIN { $ENV{DBIC_TRACE} = 0 }
10 use DBIx::Class::Carp;
15 sub DBICTest::DBICCarp::frobnicate {
16 DBICTest::DBICCarp::branch1();
17 DBICTest::DBICCarp::branch2();
20 sub DBICTest::DBICCarp::branch1 { carp_once 'carp1' }
21 sub DBICTest::DBICCarp::branch2 { carp_once 'carp2' }
25 DBICTest::DBICCarp::frobnicate();
29 ], 'expected warnings from carp_once';
34 package DBICTest::DBICCarp::Exempt;
35 use DBIx::Class::Carp;
37 sub _skip_namespace_frames { qr/^DBICTest::DBICCarp::Exempt/ }
41 DBICTest->init_schema(no_deploy => 1)->storage->dbh_do(sub {
42 shift->throw_exception('time to die');
68 # the __LINE__ relationship below is important - do not reformat
69 throws_ok { DBICTest::DBICCarp::Exempt::dcaller() }
70 qr/\QDBICTest::DBICCarp::Exempt::thrower(): time to die at @{[ __FILE__ ]} line @{[ __LINE__ - 1 ]}\E$/,
71 'Expected exception callsite and originator'
74 # the __LINE__ relationship below is important - do not reformat
75 warnings_like { DBICTest::DBICCarp::Exempt::wcaller() }
76 qr/\QDBICTest::DBICCarp::Exempt::warner(): time to warn at @{[ __FILE__ ]} line @{[ __LINE__ - 1 ]}\E$/,