Configuration from current directory
[gnucomo.git] / test / createdb
diff --git a/test/createdb b/test/createdb
new file mode 100755 (executable)
index 0000000..19221f3
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# First test. Create and destroy the database.
+
+createdb gnucomo_test
+
+if psql gnucomo_test -q <../src/database/create.sql
+then
+   psql gnucomo_test -c 'select statuscode from status'
+   result=$?
+   psql gnucomo_test -f ../src/database/destroy.sql -q
+else
+   echo Can not create test database
+   result=1
+fi
+
+dropdb gnucomo_test
+exit $result