From 83b45153f355b060a38892fec5f419c7cb40273e Mon Sep 17 00:00:00 2001 From: Athmane Madjoudj Date: Jan 09 2012 21:49:41 +0000 Subject: Add sqlite tests. --- diff --git a/tests/p_sqlite/0-install_sqlite.sh b/tests/p_sqlite/0-install_sqlite.sh new file mode 100755 index 0000000..5775872 --- /dev/null +++ b/tests/p_sqlite/0-install_sqlite.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Author: Athmane Madjoudj + +t_InstallPackage sqlite + diff --git a/tests/p_sqlite/sqlite_create_db_table.sh b/tests/p_sqlite/sqlite_create_db_table.sh new file mode 100755 index 0000000..b7daf61 --- /dev/null +++ b/tests/p_sqlite/sqlite_create_db_table.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# Author: Athmane Madjoudj + +t_Log "Running $0 - check that sqlite can database and tables." + +sqlite3 /tmp/tf_test.db 'create table tf_table(text, id INTEGER);' + +t_CheckExitStatus $? diff --git a/tests/p_sqlite/sqlite_dump_db.sh b/tests/p_sqlite/sqlite_dump_db.sh new file mode 100755 index 0000000..ba1d0c0 --- /dev/null +++ b/tests/p_sqlite/sqlite_dump_db.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# Author: Athmane Madjoudj + +t_Log "Running $0 - check that sqlite can dump database." + +sqlite3 /tmp/tf_test.db ".dump" | grep -q 'tf_sample_text' + +t_CheckExitStatus $? diff --git a/tests/p_sqlite/sqlite_insert_table.sh b/tests/p_sqlite/sqlite_insert_table.sh new file mode 100755 index 0000000..20c93e8 --- /dev/null +++ b/tests/p_sqlite/sqlite_insert_table.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# Author: Athmane Madjoudj + +t_Log "Running $0 - check that sqlite can insert into table." + +sqlite3 /tmp/tf_test.db "insert into tf_table values ('tf_sample_text',1);" + +t_CheckExitStatus $? diff --git a/tests/p_sqlite/sqlite_select_table.sh b/tests/p_sqlite/sqlite_select_table.sh new file mode 100755 index 0000000..3f26544 --- /dev/null +++ b/tests/p_sqlite/sqlite_select_table.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# Author: Athmane Madjoudj + +t_Log "Running $0 - check that sqlite can select from table." + +sqlite3 /tmp/tf_test.db "select * from tf_table;" | grep -q 'tf_sample_text' + +t_CheckExitStatus $?