[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[2922] trunk/t/40-dbsetup.t



Revision: 2922
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2922&view=rev
Author:   einhverfr
Date:     2010-02-28 06:04:26 +0000 (Sun, 28 Feb 2010)

Log Message:
-----------
beginnings of new db test script

Added Paths:
-----------
    trunk/t/40-dbsetup.t

Added: trunk/t/40-dbsetup.t
===================================================================
--- trunk/t/40-dbsetup.t	                        (rev 0)
+++ trunk/t/40-dbsetup.t	2010-02-28 06:04:26 UTC (rev 2922)
@@ -0,0 +1,31 @@
+# Database setup tests.
+
+use Test::More;
+use LedgerSMB::Form;
+use strict;
+
+#util functions
+
+# sub ok_or_die($name, $success)
+# if $success is true, then pass.
+# else bail out.
+
+my $run_tests = 1;
+for my $evar (qw(LSMB_NEW_DB LSMB_TEST_DB PG_CONTRIB_DIR)){
+  if (!defined $ENV{$evar}){
+      $run_tests = 0;
+  }
+}
+
+if ($run_tests){
+	plan tests => 2;
+	$ENV{PGDATABASE} = $ENV{LSMB_NEW_DB};
+}
+else {
+	plan skip_all => 'Skipping all.  Told not to test db.';
+}
+
+# Manual tests
+open (CREATEDB, '-|', 'createdb');
+ok_cmp(<CREATEDB>, 'eq', "CREATE DATABASE\n") || BAIL_OUT('Database could not be created!');
+close(CREATEDB);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.