diff options
Diffstat (limited to 'pgsql/native')
-rw-r--r-- | pgsql/native/buildfile | 16 | ||||
-rw-r--r-- | pgsql/native/driver.cxx | 10 | ||||
-rw-r--r-- | pgsql/native/makefile | 79 | ||||
-rw-r--r-- | pgsql/native/test.std | 0 | ||||
-rw-r--r-- | pgsql/native/testscript | 9 |
5 files changed, 31 insertions, 83 deletions
diff --git a/pgsql/native/buildfile b/pgsql/native/buildfile new file mode 100644 index 0000000..ec4c80c --- /dev/null +++ b/pgsql/native/buildfile @@ -0,0 +1,16 @@ +# file : pgsql/native/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($pgsql && !$multi || $build.meta_operation == 'dist') \ +"pgsql should be configured via config.odb_tests.database variable as a single database" + +import libs = libodb-pgsql%lib{odb-pgsql} +import libs += lib{common} + +exe{driver}: {hxx cxx}{*} $libs testscript + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{pgsql-client}: include = adhoc diff --git a/pgsql/native/driver.cxx b/pgsql/native/driver.cxx index 2cea8dd..843db41 100644 --- a/pgsql/native/driver.cxx +++ b/pgsql/native/driver.cxx @@ -4,14 +4,16 @@ // Test PostgreSQL native SQL execution. // -#include <memory> // std::auto_ptr -#include <cassert> +#include <memory> // std::unique_ptr #include <iostream> #include <odb/pgsql/database.hxx> #include <odb/pgsql/transaction.hxx> -#include <common/common.hxx> +#include <libcommon/common.hxx> + +#undef NDEBUG +#include <cassert> using namespace std; namespace pgsql = odb::pgsql; @@ -22,7 +24,7 @@ main (int argc, char* argv[]) { try { - auto_ptr<database> db (create_specific_database<database> (argc, argv)); + unique_ptr<database> db (create_specific_database<database> (argc, argv)); // Create the database schema. // diff --git a/pgsql/native/makefile b/pgsql/native/makefile deleted file mode 100644 index f82e0fc..0000000 --- a/pgsql/native/makefile +++ /dev/null @@ -1,79 +0,0 @@ -# file : pgsql/native/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) diff --git a/pgsql/native/test.std b/pgsql/native/test.std deleted file mode 100644 index e69de29..0000000 --- a/pgsql/native/test.std +++ /dev/null diff --git a/pgsql/native/testscript b/pgsql/native/testscript new file mode 100644 index 0000000..4fd9d2c --- /dev/null +++ b/pgsql/native/testscript @@ -0,0 +1,9 @@ +# file : pgsql/custom/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../pgsql.testscript + +: basics +: +$* |