Changeset 949


Ignore:
Timestamp:
Mar 18, 2007, 10:58:06 PM (15 years ago)
Author:
Earle Martin
Message:

Use skip_all for tests relying entirely on SQLite, instead of issuing skip commands with duplicate test counts and causing maintenance overhead.

Location:
trunk/t
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/t/12_macros.t

    r933 r949  
    33use OpenGuides;
    44use OpenGuides::Test;
    5 use Test::More tests => 10;
     5use Test::More;
    66
    77eval { require DBD::SQLite; };
    8 my $have_sqlite = $@ ? 0 : 1;
     8
     9if ($@) {
     10    plan skip_all => "DBD::SQLite not installed - no database to test with";
     11} else {
     12    plan tests => 10;
     13}
    914
    1015SKIP: {
    11     skip "DBD::SQLite not installed - no database to test with", 10
    12       unless $have_sqlite;
    13 
    1416    # Clear out the database from any previous runs.
    1517    unlink "t/node.db";
  • trunk/t/21_rdf.t

    r947 r949  
    66use OpenGuides::Test;
    77use URI::Escape;
    8 use Test::More tests => 24;
     8use Test::More;
    99
    1010eval { require DBD::SQLite; };
    11 my $have_sqlite = $@ ? 0 : 1;
     11
     12if ($@) {
     13    plan skip_all => "DBD::SQLite not installed - no database to test with";
     14} else {
     15    plan tests => 24;
     16}
    1217
    1318SKIP: {
    14     skip "DBD::SQLite not installed - no database to test with", 24
    15         unless $have_sqlite;
    16 
    1719    Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } );
    1820    my $config = OpenGuides::Config->new(
  • trunk/t/28_wgs84_coords.t

    r946 r949  
    33use OpenGuides;
    44use OpenGuides::Test;
    5 use Test::More tests => 6;
     5use Test::More;
    66
    77eval { require DBD::SQLite; };
    8 my $have_sqlite = $@ ? 0 : 1;
     8
     9if ($@) {
     10    plan skip_all => "DBD::SQLite not installed - no database to test with";
     11} else {
     12    plan tests => 6;
     13}
    914
    1015SKIP: {
    11     skip "DBD::SQLite not installed - no database to test with", 6
    12       unless $have_sqlite;
    13 
    1416    # Clear out the database from any previous runs.
    1517    unlink "t/node.db";
  • trunk/t/32_search_simple_metadata.t

    r785 r949  
    33use OpenGuides::Config;
    44use OpenGuides::Search;
    5 use Test::More tests => 10;
     5use Test::More;
    66
    77eval { require DBD::SQLite; };
    8 my $have_sqlite = $@ ? 0 : 1;
     8
     9if ($@) {
     10    plan skip_all => "DBD::SQLite not installed - no database to test with";
     11} else {
     12    plan tests => 10;
     13}
    914
    1015SKIP: {
    11     skip "DBD::SQLite not installed - no database to test with", 10
    12       unless $have_sqlite;
    13 
    1416    # Clear out the database from any previous runs.
    1517    unlink "t/node.db";
  • trunk/t/51_display_node.t

    r945 r949  
    33use OpenGuides::Config;
    44use OpenGuides;
    5 use Test::More tests => 7;
     5use Test::More;
    66
    77eval { require DBD::SQLite; };
    8 my $have_sqlite = $@ ? 0 : 1;
     8
     9if ($@) {
     10    plan skip_all => "DBD::SQLite not installed - no database to test with";
     11} else {
     12    plan tests => 7;
     13}
    914
    1015SKIP: {
    11     skip "DBD::SQLite not installed - no database to test with", 7
    12       unless $have_sqlite;
    1316
    1417    Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } );
  • trunk/t/52_display_diffs.t

    r785 r949  
    33use OpenGuides;
    44use OpenGuides::Test;
    5 use Test::More tests => 5;
     5use Test::More;
    66
    77eval { require DBD::SQLite; };
    8 my $have_sqlite = $@ ? 0 : 1;
     8
     9if ($@) {
     10    plan skip_all => "DBD::SQLite not installed - no database to test with";
     11} else {
     12    plan tests => 5;
     13}
     14
    915
    1016SKIP: {
    11     skip "DBD::SQLite not installed - no database to test with", 5
    12       unless $have_sqlite;
    13 
    1417    Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } );
    1518    my $config = OpenGuides::Test->make_basic_config;
  • trunk/t/53_show_index.t

    r899 r949  
    33use OpenGuides;
    44use OpenGuides::Test;
    5 use Test::More tests => 23; # 25 when all enabled
     5use Test::More;
    66
    77eval { require DBD::SQLite; };
    8 my $have_sqlite = $@ ? 0 : 1;
     8
     9if ($@) {
     10    plan skip_all => "DBD::SQLite not installed - no database to test with";
     11} else {
     12    plan tests => 23; # 25 when all enabled
     13}
    914
    1015SKIP: {
    11     skip "DBD::SQLite not installed - no database to test with", 23
    12       unless $have_sqlite;
    13 
    1416    Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } );
    1517    my $config = OpenGuides::Test->make_basic_config;
  • trunk/t/54_redirect.t

    r785 r949  
    33use OpenGuides::Config;
    44use OpenGuides;
    5 use Test::More tests => 2;
     5use Test::More;
    66
    77eval { require DBD::SQLite; };
    8 my $have_sqlite = $@ ? 0 : 1;
     8
     9if ($@) {
     10    plan skip_all => "DBD::SQLite not installed - no database to test with";
     11} else {
     12    plan tests => 2;
     13}
    914
    1015SKIP: {
    11     skip "DBD::SQLite not installed - no database to test with", 2
    12       unless $have_sqlite;
    13 
    1416    Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } );
    1517    my $config = OpenGuides::Config->new(
  • trunk/t/55_node_history.t

    r785 r949  
    22use OpenGuides;
    33use OpenGuides::Test;
    4 use Test::More tests => 2;
     4use Test::More;
    55
    66eval { require DBD::SQLite; };
    7 my $have_sqlite = $@ ? 0 : 1;
     7
     8if ($@) {
     9    plan skip_all => "DBD::SQLite not installed - no database to test with";
     10} else {
     11    plan tests => 2;
     12}
    813
    914SKIP: {
    10     skip "DBD::SQLite not installed - no database to test with", 2
    11       unless $have_sqlite;
    12 
    1315    Wiki::Toolkit::Setup::SQLite::cleardb( { dbname => "t/node.db" } );
    1416    Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } );
  • trunk/t/61_bug_textareas.t

    r785 r949  
    33use OpenGuides::Test;
    44use OpenGuides::Utils;
    5 use Test::More tests => 1;
     5use Test::More;
    66
    77eval { require DBD::SQLite; };
    8 my $have_sqlite = $@ ? 0 : 1;
     8
     9if ($@) {
     10    plan skip_all => "DBD::SQLite not installed - no database to test with";
     11} else {
     12    plan tests => 1;
     13}
    914
    1015SKIP: {
    11     skip "DBD::SQLite not installed - no database to test with", 1
    12       unless $have_sqlite;
    13 
    1416    Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } );
    1517    my $config = OpenGuides::Test->make_basic_config;
  • trunk/t/63_bug_map_link_no_address.t

    r785 r949  
    22use OpenGuides;
    33use OpenGuides::Test;
    4 use Test::More tests => 1;
     4use Test::More;
    55
    66eval { require DBD::SQLite; };
    7 my $have_sqlite = $@ ? 0 : 1;
     7
     8if ($@) {
     9    plan skip_all => "DBD::SQLite not installed - no database to test with";
     10} else {
     11    plan tests => 1;
     12}
    813
    914SKIP: {
    10     skip "DBD::SQLite not installed - no database to test with", 1
    11       unless $have_sqlite;
    12 
    1315    Wiki::Toolkit::Setup::SQLite::cleardb( { dbname => "t/node.db" } );
    1416    Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } );
  • trunk/t/64_bug_node_history.t

    r785 r949  
    33use Cwd;
    44use OpenGuides;
    5 use Test::More tests => 1;
     5use Test::More;
    66
    77eval { require DBD::SQLite; };
    8 my $have_sqlite = $@ ? 0 : 1;
     8
     9if ($@) {
     10    plan skip_all => "DBD::SQLite not installed - no database to test with";
     11} else {
     12    plan tests => 1;
     13}
    914
    1015SKIP: {
    11     skip "DBD::SQLite not installed - no database to test with", 1
    12       unless $have_sqlite;
    1316
    1417    Wiki::Toolkit::Setup::SQLite::cleardb( { dbname => "t/node.db" } );
  • trunk/t/68_bug_website_displayed.t

    r812 r949  
    22use OpenGuides;
    33use OpenGuides::Test;
    4 use Test::More tests => 1;
     4use Test::More;
    55
    66eval { require DBD::SQLite; };
    7 my $have_sqlite = $@ ? 0 : 1;
     7
     8if ($@) {
     9    plan skip_all => "DBD::SQLite not installed - no database to test with";
     10} else {
     11    plan tests => 1;
     12}
    813
    914SKIP: {
    10     skip "DBD::SQLite not installed - no database to test with", 1
    11       unless $have_sqlite;
    12 
    1315    Wiki::Toolkit::Setup::SQLite::cleardb( { dbname => "t/node.db" } );
    1416    Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } );
  • trunk/t/70_admin_home.t

    r943 r949  
    33use OpenGuides;
    44use OpenGuides::Test;
    5 use Test::More tests => 17;
     5use Test::More;
    66
    77eval { require DBD::SQLite; };
    8 my $have_sqlite = $@ ? 0 : 1;
     8
     9if ($@) {
     10    plan skip_all => "DBD::SQLite not installed - no database to test with";
     11} else {
     12    plan tests => 17;
     13}
    914
    1015SKIP: {
    11     skip "DBD::SQLite not installed - no database to test with", 17
    12       unless $have_sqlite;
    13 
    1416    Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } );
    1517    my $config = OpenGuides::Test->make_basic_config;
  • trunk/t/71_missing_metadata.t

    r832 r949  
    33use OpenGuides;
    44use OpenGuides::Test;
    5 use Test::More tests => 26;
     5use Test::More;
    66
    77eval { require DBD::SQLite; };
    8 my $have_sqlite = $@ ? 0 : 1;
     8
     9if ($@) {
     10    plan skip_all => "DBD::SQLite not installed - no database to test with";
     11} else {
     12    plan tests => 26;
     13}
    914
    1015SKIP: {
    11     skip "DBD::SQLite not installed - no database to test with", 26
    12       unless $have_sqlite;
    13 
    1416    Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } );
    1517    my $config = OpenGuides::Test->make_basic_config;
  • trunk/t/72_node_moderation.t

    r847 r949  
    33use OpenGuides;
    44use OpenGuides::Test;
    5 use Test::More tests => 19;
     5use Test::More;
    66
    77eval { require DBD::SQLite; };
    8 my $have_sqlite = $@ ? 0 : 1;
     8
     9if ($@) {
     10    plan skip_all => "DBD::SQLite not installed - no database to test with";
     11} else {
     12    plan tests => 19;
     13}
    914
    1015SKIP: {
    11     skip "DBD::SQLite not installed - no database to test with", 19
    12       unless $have_sqlite;
    13 
    1416    Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } );
    1517    my $config = OpenGuides::Test->make_basic_config;
  • trunk/t/73_toggle_moderation.t

    r896 r949  
    33use OpenGuides;
    44use OpenGuides::Test;
    5 use Test::More tests => 14;
     5use Test::More;
    66
    77eval { require DBD::SQLite; };
    8 my $have_sqlite = $@ ? 0 : 1;
     8
     9if ($@) {
     10    plan skip_all => "DBD::SQLite not installed - no database to test with";
     11} else {
     12    plan tests => 14;
     13}
    914
    1015SKIP: {
    11     skip "DBD::SQLite not installed - no database to test with", 14
    12       unless $have_sqlite;
    13 
    1416    Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } );
    1517    my $config = OpenGuides::Test->make_basic_config;
Note: See TracChangeset for help on using the changeset viewer.