-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
81 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package ExampleCase; | ||
|
||
use strict; | ||
use Test::More; | ||
use parent 'DBITestCaseBase'; | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package DBITestCaseBase; | ||
|
||
# This is all very rough, experimental, and may change completely | ||
|
||
use strict; | ||
|
||
use Test::More; | ||
|
||
use Try::Tiny; | ||
|
||
|
||
# this method is kept very simple because some tests might want to | ||
# override this and/or find_and_call_subtests to reuse the fixtures | ||
# for multiple similar test runs, e.g. with different connection attributes | ||
sub run_tests { | ||
my ($class) = @_; | ||
|
||
try { | ||
$class->setup; | ||
$class->find_and_call_subtests; | ||
} | ||
catch { | ||
fail "Caught exception: $_"; | ||
} | ||
finally { | ||
$class->teardown; | ||
}; | ||
|
||
return; | ||
} | ||
|
||
|
||
sub setup { | ||
pass "base setup"; | ||
return; | ||
} | ||
|
||
|
||
sub teardown { | ||
pass "base teardown"; | ||
done_testing(); # XXX here? | ||
return; | ||
} | ||
|
||
sub find_and_call_subtests { | ||
my ($class) = @_; | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package DBM::ExampleExtraTests; | ||
|
||
use strict; | ||
use Test::More; | ||
use parent 'DBITestCaseBase'; | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters