diff --git a/configure.ac b/configure.ac index 24be2bce..20abc4b9 100644 --- a/configure.ac +++ b/configure.ac @@ -65,6 +65,12 @@ AC_PROG_RANLIB AC_PROG_LN_S AC_PROG_MAKE_SET +AC_PATH_PROG(SQLITE3_CMD, [sqlite3]) + +if test x"$SQLITE3_CMD" = x""; then + AC_MSG_ERROR([The sqlite3 command is required]) +fi + AC_PATH_PROG(BZIP2_CMD, [bzip2]) AC_CHECK_SIZEOF(off_t) diff --git a/test/Makefile.am b/test/Makefile.am index cffa1a65..1774468a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -2,10 +2,18 @@ TESTS_ENVIRONMENT = $(SHELL) $(top_builddir)/TESTS_ENVIRONMENT LOG_COMPILER = $(SHELL) $(top_builddir)/TESTS_ENVIRONMENT +DBGEN_V = $(DBGEN_V_@AM_V@) +DBGEN_V_ = $(DBGEN_V_@AM_DEFAULT_V@) +DBGEN_V_0 = @echo " DBGEN " $@; + RM_V = $(RM_V_@AM_V@) RM_V_ = $(RM_V_@AM_DEFAULT_V@) RM_V_0 = @echo " RM " $@; +simple-db.db: simple-db.sql + $(RM_V)rm -f $@ + $(DBGEN_V)$(SQLITE3_CMD) $@ < $(srcdir)/simple-db.sql + AM_CPPFLAGS = \ -Wall \ -I$(top_srcdir)/src \ @@ -237,6 +245,7 @@ dist_noinst_DATA = \ logfile_with_a_really_long_name_to_test_a_bug_with_long_names.0 \ multiline.lnav \ mvwattrline_output.0 \ + simple-db.sql \ view_colors_output.0 \ vt52_curses_input.0 \ vt52_curses_input.1 \ @@ -249,6 +258,9 @@ dist_noinst_DATA = \ log-samples/sample-70c906b3c1a1cf03f15bde92ee78edfa6f9b7960.txt \ log-samples/sample-ad31f12d2adabd07e3ddda3ad5b0dbf6b49c4c99.txt +nodist_noinst_DATA = \ + simple-db.db + TESTS = \ test_ansi_scrubber \ test_auto_fd \ diff --git a/test/simple-db.sql b/test/simple-db.sql new file mode 100644 index 00000000..a5c30c7b --- /dev/null +++ b/test/simple-db.sql @@ -0,0 +1,12 @@ + +CREATE TABLE IF NOT EXISTS person ( + id integer PRIMARY KEY, + first_name text, + last_name text, + age integer +); + +INSERT INTO person (id, first_name, last_name, age) + VALUES (0, "Phil", "Myman", 30); +INSERT INTO person (id, first_name, last_name, age) + VALUES (1, "Lem", "Hewitt", 35);