From fc3fb39c90ab7fe5fccbe3f3bc0eb2645157bb96 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 13 Dec 2023 21:57:53 +0300 Subject: Switch to build2 --- sqlite/Makefile.am | 5 - sqlite/attach/buildfile | 32 +++ sqlite/attach/driver.cxx | 16 +- sqlite/attach/makefile | 108 -------- sqlite/attach/test.std | 0 sqlite/attach/testscript | 9 + sqlite/auto/buildfile | 32 +++ sqlite/auto/driver.cxx | 16 +- sqlite/auto/makefile | 108 -------- sqlite/auto/test.std | 0 sqlite/auto/testscript | 9 + sqlite/custom/buildfile | 31 +++ sqlite/custom/driver.cxx | 14 +- sqlite/custom/makefile | 107 -------- sqlite/custom/test.std | 0 sqlite/custom/testscript | 9 + sqlite/database/buildfile | 11 + sqlite/database/driver.cxx | 5 +- sqlite/database/makefile | 83 ------ sqlite/database/test.std | 0 sqlite/database/testscript | 6 + sqlite/makefile | 44 ---- sqlite/native/buildfile | 12 + sqlite/native/driver.cxx | 10 +- sqlite/native/makefile | 83 ------ sqlite/native/test.std | 0 sqlite/native/testscript | 9 + sqlite/stream/buildfile | 31 +++ sqlite/stream/driver.cxx | 14 +- sqlite/stream/makefile | 107 -------- sqlite/stream/test.std | 0 sqlite/stream/testscript | 9 + sqlite/template/Makefile.am | 34 --- sqlite/template/driver.cxx | 40 --- sqlite/template/makefile | 108 -------- sqlite/template/template-vc10.vcxproj | 180 ------------- sqlite/template/template-vc10.vcxproj.filters | 25 -- sqlite/template/template-vc11.vcxproj | 184 ------------- sqlite/template/template-vc11.vcxproj.filters | 25 -- sqlite/template/template-vc12.vcxproj | 188 -------------- sqlite/template/template-vc12.vcxproj.filters | 25 -- sqlite/template/template-vc8.vcproj | 354 ------------------------- sqlite/template/template-vc9.vcproj | 361 -------------------------- sqlite/template/test.hxx | 25 -- sqlite/template/test.std | 0 sqlite/test.bat | 68 ----- sqlite/transaction/buildfile | 30 +++ sqlite/transaction/driver.cxx | 10 +- sqlite/transaction/makefile | 107 -------- sqlite/transaction/test.std | 0 sqlite/transaction/testscript | 9 + sqlite/truncation/buildfile | 31 +++ sqlite/truncation/driver.cxx | 16 +- sqlite/truncation/makefile | 107 -------- sqlite/truncation/test.std | 0 sqlite/truncation/testscript | 9 + sqlite/types/buildfile | 32 +++ sqlite/types/driver.cxx | 18 +- sqlite/types/makefile | 109 -------- sqlite/types/test.hxx | 4 +- sqlite/types/test.std | 0 sqlite/types/testscript | 9 + 62 files changed, 390 insertions(+), 2638 deletions(-) delete mode 100644 sqlite/Makefile.am create mode 100644 sqlite/attach/buildfile delete mode 100644 sqlite/attach/makefile delete mode 100644 sqlite/attach/test.std create mode 100644 sqlite/attach/testscript create mode 100644 sqlite/auto/buildfile delete mode 100644 sqlite/auto/makefile delete mode 100644 sqlite/auto/test.std create mode 100644 sqlite/auto/testscript create mode 100644 sqlite/custom/buildfile delete mode 100644 sqlite/custom/makefile delete mode 100644 sqlite/custom/test.std create mode 100644 sqlite/custom/testscript create mode 100644 sqlite/database/buildfile delete mode 100644 sqlite/database/makefile delete mode 100644 sqlite/database/test.std create mode 100644 sqlite/database/testscript delete mode 100644 sqlite/makefile create mode 100644 sqlite/native/buildfile delete mode 100644 sqlite/native/makefile delete mode 100644 sqlite/native/test.std create mode 100644 sqlite/native/testscript create mode 100644 sqlite/stream/buildfile delete mode 100644 sqlite/stream/makefile delete mode 100644 sqlite/stream/test.std create mode 100644 sqlite/stream/testscript delete mode 100644 sqlite/template/Makefile.am delete mode 100644 sqlite/template/driver.cxx delete mode 100644 sqlite/template/makefile delete mode 100644 sqlite/template/template-vc10.vcxproj delete mode 100644 sqlite/template/template-vc10.vcxproj.filters delete mode 100644 sqlite/template/template-vc11.vcxproj delete mode 100644 sqlite/template/template-vc11.vcxproj.filters delete mode 100644 sqlite/template/template-vc12.vcxproj delete mode 100644 sqlite/template/template-vc12.vcxproj.filters delete mode 100644 sqlite/template/template-vc8.vcproj delete mode 100644 sqlite/template/template-vc9.vcproj delete mode 100644 sqlite/template/test.hxx delete mode 100644 sqlite/template/test.std delete mode 100644 sqlite/test.bat create mode 100644 sqlite/transaction/buildfile delete mode 100644 sqlite/transaction/makefile delete mode 100644 sqlite/transaction/test.std create mode 100644 sqlite/transaction/testscript create mode 100644 sqlite/truncation/buildfile delete mode 100644 sqlite/truncation/makefile delete mode 100644 sqlite/truncation/test.std create mode 100644 sqlite/truncation/testscript create mode 100644 sqlite/types/buildfile delete mode 100644 sqlite/types/makefile delete mode 100644 sqlite/types/test.std create mode 100644 sqlite/types/testscript (limited to 'sqlite') diff --git a/sqlite/Makefile.am b/sqlite/Makefile.am deleted file mode 100644 index 998e823..0000000 --- a/sqlite/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# file : sqlite/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) -EXTRA_DIST = __file__(extra_dist) diff --git a/sqlite/attach/buildfile b/sqlite/attach/buildfile new file mode 100644 index 0000000..959f050 --- /dev/null +++ b/sqlite/attach/buildfile @@ -0,0 +1,32 @@ +# file : sqlite/attach/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-sqlite%lib{odb-sqlite} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix sqlitex_attach_ \ + --generate-schema \ + --default-database common \ + --generate-query \ + --schema main + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/attach/driver.cxx b/sqlite/attach/driver.cxx index 8d0672f..25d279f 100644 --- a/sqlite/attach/driver.cxx +++ b/sqlite/attach/driver.cxx @@ -4,8 +4,7 @@ // Test attached database support. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include @@ -14,11 +13,14 @@ #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace sqlite = odb::sqlite; using namespace sqlite; @@ -28,7 +30,7 @@ main (int argc, char* argv[]) { try { - auto_ptr mdb (create_specific_database (argc, argv)); + unique_ptr mdb (create_specific_database (argc, argv)); { object o ("one"); @@ -58,7 +60,7 @@ main (int argc, char* argv[]) { transaction t (c->begin ()); - auto_ptr p (adb.load (o.id)); + unique_ptr p (adb.load (o.id)); t.commit (); assert (p->str == o.str); @@ -76,7 +78,7 @@ main (int argc, char* argv[]) typedef sqlite::query query; transaction t (c->begin ()); - auto_ptr p (adb.query_one (query::str == "two")); + unique_ptr p (adb.query_one (query::str == "two")); t.commit (); assert (p->str == o.str); @@ -90,7 +92,7 @@ main (int argc, char* argv[]) { transaction t (c->begin ()); - auto_ptr p (mdb->load (o.id)); + unique_ptr p (mdb->load (o.id)); t.commit (); assert (p.get () != 0); diff --git a/sqlite/attach/makefile b/sqlite/attach/makefile deleted file mode 100644 index 1ae325d..0000000 --- a/sqlite/attach/makefile +++ /dev/null @@ -1,108 +0,0 @@ -# file : sqlite/attach/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.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 - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# 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) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --default-database \ -common --generate-query --generate-schema --table-prefix sqlitex_attach_ \ ---schema main -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(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) $(headers) $(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)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(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/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/attach/test.std b/sqlite/attach/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/sqlite/attach/testscript b/sqlite/attach/testscript new file mode 100644 index 0000000..db5089d --- /dev/null +++ b/sqlite/attach/testscript @@ -0,0 +1,9 @@ +# file : sqlite/attach/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/sqlite/auto/buildfile b/sqlite/auto/buildfile new file mode 100644 index 0000000..2c70b7c --- /dev/null +++ b/sqlite/auto/buildfile @@ -0,0 +1,32 @@ +# file : sqlite/auto/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-sqlite%lib{odb-sqlite} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix sqlitex_auto_ \ + --generate-schema \ + --default-database common \ + --generate-query \ + --sqlite-lax-auto-id + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/auto/driver.cxx b/sqlite/auto/driver.cxx index 4ac29b3..bcd42c1 100644 --- a/sqlite/auto/driver.cxx +++ b/sqlite/auto/driver.cxx @@ -4,18 +4,20 @@ // Test manual/automatic id assignment. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace sqlite = odb::sqlite; using namespace sqlite; @@ -25,7 +27,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); // object // @@ -55,9 +57,9 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o1 (db->load (id1)); - auto_ptr o2 (db->load (id2)); - auto_ptr o3 (db->load (id3)); + unique_ptr o1 (db->load (id1)); + unique_ptr o2 (db->load (id2)); + unique_ptr o3 (db->load (id3)); t.commit (); assert (*o1->id_ == id1 && o1->str_ == "one"); diff --git a/sqlite/auto/makefile b/sqlite/auto/makefile deleted file mode 100644 index 6da7071..0000000 --- a/sqlite/auto/makefile +++ /dev/null @@ -1,108 +0,0 @@ -# file : sqlite/auto/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.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 - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# 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) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --default-database \ -common --generate-query --generate-schema --table-prefix sqlitex_auto_ \ ---sqlite-lax-auto-id -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(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) $(headers) $(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)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(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/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/auto/test.std b/sqlite/auto/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/sqlite/auto/testscript b/sqlite/auto/testscript new file mode 100644 index 0000000..a5a7da5 --- /dev/null +++ b/sqlite/auto/testscript @@ -0,0 +1,9 @@ +# file : sqlite/auto/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/sqlite/custom/buildfile b/sqlite/custom/buildfile new file mode 100644 index 0000000..3325762 --- /dev/null +++ b/sqlite/custom/buildfile @@ -0,0 +1,31 @@ +# file : sqlite/custom/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-sqlite%lib{odb-sqlite} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix sqlitex_custom_ \ + --generate-schema \ + --default-database common \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/custom/driver.cxx b/sqlite/custom/driver.cxx index b53c0f6..0627708 100644 --- a/sqlite/custom/driver.cxx +++ b/sqlite/custom/driver.cxx @@ -4,18 +4,20 @@ // Test custom database type mapping in SQLite. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace sqlite = odb::sqlite; using namespace sqlite; @@ -25,7 +27,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); object o (1); o.nv.push_back ("123"); // INTEGER @@ -44,7 +46,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); + unique_ptr o1 (db->load (1)); t.commit (); assert (o == *o1); @@ -62,7 +64,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); + unique_ptr o1 (db->load (1)); t.commit (); assert (o == *o1); diff --git a/sqlite/custom/makefile b/sqlite/custom/makefile deleted file mode 100644 index 39f1c76..0000000 --- a/sqlite/custom/makefile +++ /dev/null @@ -1,107 +0,0 @@ -# file : sqlite/custom/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.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 - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# 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) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --default-database \ -common --generate-schema --generate-query --table-prefix sqlitex_custom_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(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) $(headers) $(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)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(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/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/custom/test.std b/sqlite/custom/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/sqlite/custom/testscript b/sqlite/custom/testscript new file mode 100644 index 0000000..53561ae --- /dev/null +++ b/sqlite/custom/testscript @@ -0,0 +1,9 @@ +# file : sqlite/custom/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/sqlite/database/buildfile b/sqlite/database/buildfile new file mode 100644 index 0000000..e74ab1a --- /dev/null +++ b/sqlite/database/buildfile @@ -0,0 +1,11 @@ +# file : sqlite/database/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libs = libodb-sqlite%lib{odb-sqlite} + +exe{driver}: {hxx cxx}{*} $libs testscript + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/database/driver.cxx b/sqlite/database/driver.cxx index d0fe198..5e16653 100644 --- a/sqlite/database/driver.cxx +++ b/sqlite/database/driver.cxx @@ -4,10 +4,11 @@ // Test that database constructors are unambiguous and some other things. // -#include - #include +#undef NDEBUG +#include + namespace sqlite = odb::sqlite; using namespace sqlite; diff --git a/sqlite/database/makefile b/sqlite/database/makefile deleted file mode 100644 index 4a2a5ef..0000000 --- a/sqlite/database/makefile +++ /dev/null @@ -1,83 +0,0 @@ -# file : sqlite/database/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)/sqlite/,,$(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) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/database/test.std b/sqlite/database/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/sqlite/database/testscript b/sqlite/database/testscript new file mode 100644 index 0000000..b9c0f5f --- /dev/null +++ b/sqlite/database/testscript @@ -0,0 +1,6 @@ +# file : sqlite/database/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +: basics +: +$* diff --git a/sqlite/makefile b/sqlite/makefile deleted file mode 100644 index a80d464..0000000 --- a/sqlite/makefile +++ /dev/null @@ -1,44 +0,0 @@ -# file : sqlite/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make - -tests := \ -template \ -attach \ -auto \ -custom \ -database \ -native \ -stream \ -transaction \ -truncation \ -types - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) - -$(dist): name := sqlite -$(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ -$(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) - $(call meta-automake) - $(call meta-vc8sln1,$(name)) - $(call meta-vc9sln1,$(name)) - $(call meta-vc10sln1,$(name)) - $(call meta-vc11sln1,$(name)) - $(call meta-vc12sln1,$(name)) - $(call meta-vctest,$(name)-vc10.sln,test.bat) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) - -$(call include,$(bld_root)/meta/vc8sln.make) -$(call include,$(bld_root)/meta/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.make) -$(call include,$(bld_root)/meta/vc11sln.make) -$(call include,$(bld_root)/meta/vc12sln.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) - -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/sqlite/native/buildfile b/sqlite/native/buildfile new file mode 100644 index 0000000..49aa05b --- /dev/null +++ b/sqlite/native/buildfile @@ -0,0 +1,12 @@ +# file : sqlite/native/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libs = libodb-sqlite%lib{odb-sqlite} +import libs += lib{common} + +exe{driver}: {hxx cxx}{*} $libs testscript + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/native/driver.cxx b/sqlite/native/driver.cxx index 10a6b05..c87aa5d 100644 --- a/sqlite/native/driver.cxx +++ b/sqlite/native/driver.cxx @@ -4,14 +4,16 @@ // Test native SQL execution. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include + +#undef NDEBUG +#include using namespace std; namespace sqlite = odb::sqlite; @@ -22,7 +24,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db ( + unique_ptr db ( create_specific_database (argc, argv, false)); // Create the database schema. diff --git a/sqlite/native/makefile b/sqlite/native/makefile deleted file mode 100644 index c5434f0..0000000 --- a/sqlite/native/makefile +++ /dev/null @@ -1,83 +0,0 @@ -# file : sqlite/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)/sqlite/,,$(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) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/native/test.std b/sqlite/native/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/sqlite/native/testscript b/sqlite/native/testscript new file mode 100644 index 0000000..16f05e0 --- /dev/null +++ b/sqlite/native/testscript @@ -0,0 +1,9 @@ +# file : sqlite/native/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/sqlite/stream/buildfile b/sqlite/stream/buildfile new file mode 100644 index 0000000..fb8f605 --- /dev/null +++ b/sqlite/stream/buildfile @@ -0,0 +1,31 @@ +# file : sqlite/stream/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} +import libodb_sqlite = libodb-sqlite%lib{odb-sqlite} +import libs = lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb and +# libodb-sqlite libraries are resolved for the odb_compile ad hoc rule (see +# build/root.build for details). +# +libue{test-meta}: $libodb $libodb_sqlite + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix sqlitex_stream_ \ + --generate-schema \ + --default-database common \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/stream/driver.cxx b/sqlite/stream/driver.cxx index 7049b8b..86522ec 100644 --- a/sqlite/stream/driver.cxx +++ b/sqlite/stream/driver.cxx @@ -5,8 +5,7 @@ // #include -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include @@ -15,11 +14,14 @@ #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace sqlite = odb::sqlite; using namespace sqlite; @@ -41,7 +43,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); string txt (1024 * 1024, 't'); vector blb (1024 * 1024, 'b'); @@ -80,7 +82,7 @@ main (int argc, char* argv[]) { transaction tx (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); print (p->t); print (p->b); @@ -169,7 +171,7 @@ main (int argc, char* argv[]) { transaction tx (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); print (p->t); print (p->b); diff --git a/sqlite/stream/makefile b/sqlite/stream/makefile deleted file mode 100644 index 1a46b62..0000000 --- a/sqlite/stream/makefile +++ /dev/null @@ -1,107 +0,0 @@ -# file : sqlite/stream/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.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 - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# 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) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --default-database \ -common --generate-query --generate-schema --table-prefix sqlitex_stream_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(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) $(headers) $(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)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(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/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/stream/test.std b/sqlite/stream/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/sqlite/stream/testscript b/sqlite/stream/testscript new file mode 100644 index 0000000..2b9f019 --- /dev/null +++ b/sqlite/stream/testscript @@ -0,0 +1,9 @@ +# file : sqlite/stream/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/sqlite/template/Makefile.am b/sqlite/template/Makefile.am deleted file mode 100644 index b922bf1..0000000 --- a/sqlite/template/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# file : sqlite/template/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -EXTRA_DIST = __file__(extra_dist) - -noinst_PROGRAMS = driver -driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -LDADD = $(top_builddir)/libcommon/common/libcommon.la -AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' - -TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; - -__ifelse__(__value__(odb_options),,, - -# ODB compilation. -# -driver_SOURCES += test.hxx -nodist_driver_SOURCES = test-odb.cxx -BUILT_SOURCES = test-odb.hxx -CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx - -ODB = @ODB@ -ODBFLAGS = @ODBFLAGS@ -ODBCPPFLAGS = @ODBCPPFLAGS@ - -if HAVE_CXX11 -ODBFLAGS += --std c++11 -endif - -test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< -) diff --git a/sqlite/template/driver.cxx b/sqlite/template/driver.cxx deleted file mode 100644 index 95fdfb0..0000000 --- a/sqlite/template/driver.cxx +++ /dev/null @@ -1,40 +0,0 @@ -// file : sqlite/template/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// PLACE TEST DESCRIPTION HERE -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -namespace sqlite = odb::sqlite; -using namespace sqlite; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_specific_database (argc, argv)); - - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/sqlite/template/makefile b/sqlite/template/makefile deleted file mode 100644 index 45ba099..0000000 --- a/sqlite/template/makefile +++ /dev/null @@ -1,108 +0,0 @@ -# file : sqlite/template/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.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 - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# 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) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --default-database \ -common --generate-schema --table-prefix sqlitex_template_ #@@ CHANGE THIS -# Note: 'x' here is not a typo. -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(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) $(headers) $(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)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(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/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/template/template-vc10.vcxproj b/sqlite/template/template-vc10.vcxproj deleted file mode 100644 index 8e11aa6..0000000 --- a/sqlite/template/template-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-sqlite.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/sqlite/template/template-vc10.vcxproj.filters b/sqlite/template/template-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/sqlite/template/template-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/sqlite/template/template-vc11.vcxproj b/sqlite/template/template-vc11.vcxproj deleted file mode 100644 index 54fc9ef..0000000 --- a/sqlite/template/template-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-sqlite.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/sqlite/template/template-vc11.vcxproj.filters b/sqlite/template/template-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/sqlite/template/template-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/sqlite/template/template-vc12.vcxproj b/sqlite/template/template-vc12.vcxproj deleted file mode 100644 index 09beff2..0000000 --- a/sqlite/template/template-vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-sqlite.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/sqlite/template/template-vc12.vcxproj.filters b/sqlite/template/template-vc12.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/sqlite/template/template-vc12.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/sqlite/template/template-vc8.vcproj b/sqlite/template/template-vc8.vcproj deleted file mode 100644 index ef608ba..0000000 --- a/sqlite/template/template-vc8.vcproj +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/sqlite/template/template-vc9.vcproj b/sqlite/template/template-vc9.vcproj deleted file mode 100644 index 960f086..0000000 --- a/sqlite/template/template-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/sqlite/template/test.hxx b/sqlite/template/test.hxx deleted file mode 100644 index 63e07d5..0000000 --- a/sqlite/template/test.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : sqlite/template/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // TEST_HXX diff --git a/sqlite/template/test.std b/sqlite/template/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/sqlite/test.bat b/sqlite/test.bat deleted file mode 100644 index ab29f82..0000000 --- a/sqlite/test.bat +++ /dev/null @@ -1,68 +0,0 @@ -@echo off -rem file : sqlite/test.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -setlocal - -set "tests=__path__(dirs)" -set "confs=__path__(configurations)" -set "plats=__path__(platforms)" -set "curdir=%CD%" -set "topdir=%curdir%\.." -set "failed=" - -goto start - -rem -rem %1 - test directory -rem %2 - configuration -rem %3 - platform -rem -:run_test - cd %1 - - if "_%3_" == "_Win32_" ( - set "dir=%2" - ) else ( - set "dir=%3\%2" - ) - - if exist %dir%\driver.exe ( - echo %1\%3\%2 - call %topdir%\tester.bat sqlite %2 %3 - if errorlevel 1 ( - set "failed=%failed% %1\%3\%2" - ) - ) - - cd %curdir% -goto :eof - -:start - -for %%t in (%tests%) do ( - for %%c in (%confs%) do ( - for %%p in (%plats%) do ( - call :run_test %%t %%c %%p - ) - ) -) - -if not "_%failed%_" == "__" goto error - -echo. -echo ALL TESTS PASSED -echo. -goto end - -:error -if not "_%failed%_" == "__" ( - echo. - for %%t in (%failed%) do echo FAILED: %%t - echo. -) -endlocal -exit /b 1 - -:end -endlocal diff --git a/sqlite/transaction/buildfile b/sqlite/transaction/buildfile new file mode 100644 index 0000000..e29092d --- /dev/null +++ b/sqlite/transaction/buildfile @@ -0,0 +1,30 @@ +# file : sqlite/transaction/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-sqlite%lib{odb-sqlite} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix sqlitex_transaction_ \ + --generate-schema \ + --default-database common + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/transaction/driver.cxx b/sqlite/transaction/driver.cxx index 8eb8f2c..80a0804 100644 --- a/sqlite/transaction/driver.cxx +++ b/sqlite/transaction/driver.cxx @@ -4,18 +4,20 @@ // Test esoteric SQLite transaction semantics aspects. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace sqlite = odb::sqlite; using namespace sqlite; @@ -25,7 +27,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); // In SQLite, when a commit fails because of the deferred foreign // key constraint violation, the transaction is not automatically diff --git a/sqlite/transaction/makefile b/sqlite/transaction/makefile deleted file mode 100644 index 14e4ca0..0000000 --- a/sqlite/transaction/makefile +++ /dev/null @@ -1,107 +0,0 @@ -# file : sqlite/transaction/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.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 - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# 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) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --default-database \ -common --generate-schema --table-prefix sqlitex_transaction_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(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) $(headers) $(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)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(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/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/transaction/test.std b/sqlite/transaction/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/sqlite/transaction/testscript b/sqlite/transaction/testscript new file mode 100644 index 0000000..c3388cb --- /dev/null +++ b/sqlite/transaction/testscript @@ -0,0 +1,9 @@ +# file : sqlite/transaction/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/sqlite/truncation/buildfile b/sqlite/truncation/buildfile new file mode 100644 index 0000000..9a014e6 --- /dev/null +++ b/sqlite/truncation/buildfile @@ -0,0 +1,31 @@ +# file : sqlite/truncation/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-sqlite%lib{odb-sqlite} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix sqlitex_truncation_ \ + --generate-schema \ + --default-database common \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/truncation/driver.cxx b/sqlite/truncation/driver.cxx index 5ab6c29..a2f6d66 100644 --- a/sqlite/truncation/driver.cxx +++ b/sqlite/truncation/driver.cxx @@ -4,18 +4,20 @@ // Test insufficient buffer/truncation handling. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace sqlite = odb::sqlite; using namespace sqlite; @@ -33,7 +35,7 @@ main (int argc, char* argv[]) // Test basic operations. // { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); // Run persist/load so that the initial bindings are established // (version == 0). @@ -71,7 +73,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o (db->load (3)); + unique_ptr o (db->load (3)); assert (o->str_ == long_str); t.commit (); } @@ -89,7 +91,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o (db->load (3)); + unique_ptr o (db->load (3)); assert (o->str_ == longer_str); t.commit (); } @@ -98,7 +100,7 @@ main (int argc, char* argv[]) // Test query. // { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); typedef sqlite::query query; typedef odb::result result; diff --git a/sqlite/truncation/makefile b/sqlite/truncation/makefile deleted file mode 100644 index 4e7e0e3..0000000 --- a/sqlite/truncation/makefile +++ /dev/null @@ -1,107 +0,0 @@ -# file : sqlite/truncation/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.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 - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# 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) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --default-database \ -common --generate-schema --generate-query --table-prefix sqlitex_truncation_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(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) $(headers) $(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)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(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/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/truncation/test.std b/sqlite/truncation/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/sqlite/truncation/testscript b/sqlite/truncation/testscript new file mode 100644 index 0000000..97e04f7 --- /dev/null +++ b/sqlite/truncation/testscript @@ -0,0 +1,9 @@ +# file : sqlite/truncation/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/sqlite/types/buildfile b/sqlite/types/buildfile new file mode 100644 index 0000000..1bf719d --- /dev/null +++ b/sqlite/types/buildfile @@ -0,0 +1,32 @@ +# file : sqlite/types/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-sqlite%lib{odb-sqlite} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix sqlitex_types_ \ + --generate-schema \ + --default-database common \ + --generate-query \ + --cxx-prologue '#include "traits.hxx"' + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/types/driver.cxx b/sqlite/types/driver.cxx index 8f25330..b444d94 100644 --- a/sqlite/types/driver.cxx +++ b/sqlite/types/driver.cxx @@ -5,18 +5,20 @@ // #include // std::numeric_limits -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace sqlite = odb::sqlite; using namespace sqlite; @@ -26,7 +28,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); object o (1); @@ -51,7 +53,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); + unique_ptr o1 (db->load (1)); t.commit (); assert (o == *o1); @@ -92,9 +94,9 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (1)); - auto_ptr p2 (db->load (2)); - auto_ptr p3 (db->load (3)); + unique_ptr p1 (db->load (1)); + unique_ptr p2 (db->load (2)); + unique_ptr p3 (db->load (3)); t.commit (); assert (o1 == *p1); diff --git a/sqlite/types/makefile b/sqlite/types/makefile deleted file mode 100644 index f3810b2..0000000 --- a/sqlite/types/makefile +++ /dev/null @@ -1,109 +0,0 @@ -# file : sqlite/types/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.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 - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# 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) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --default-database \ -common --generate-schema --generate-query --cxx-prologue \ -'\#include "traits.hxx"' --table-prefix sqlitex_types_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := traits.hxx -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(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) $(headers) $(extra_headers) $(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)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(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/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/types/test.hxx b/sqlite/types/test.hxx index f642738..fe0b274 100644 --- a/sqlite/types/test.hxx +++ b/sqlite/types/test.hxx @@ -7,7 +7,7 @@ #include #include #include -#include // std::auto_ptr +#include // std::unique_ptr #include // std::memcpy, std::str[n]cmp, std::strlen #ifdef _WIN32 @@ -16,7 +16,7 @@ #include -typedef std::auto_ptr string_ptr; +typedef std::unique_ptr string_ptr; #pragma db object struct object diff --git a/sqlite/types/test.std b/sqlite/types/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/sqlite/types/testscript b/sqlite/types/testscript new file mode 100644 index 0000000..5e50d32 --- /dev/null +++ b/sqlite/types/testscript @@ -0,0 +1,9 @@ +# file : sqlite/types/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* -- cgit v1.1