From 35662787f479b93b3205310934574132609461cc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 8 Nov 2011 12:36:25 +0200 Subject: Get rid of special tracer database The include, types, and pragma tests have been moved to the common/ directory while the object test has been merged into common/lifecycle. The transaction test will be re-implemented as common/ test as soon as SQL statement tracing support is merged. --- tracer/Makefile.am | 7 - tracer/include/driver.cxx | 41 --- tracer/include/makefile | 90 ------- tracer/include/obj1.hxx | 27 -- tracer/include/obj2.hxx | 27 -- tracer/include/obj3.hxx | 27 -- tracer/include/objs1.hxx | 15 -- tracer/include/objs2.hxx | 15 -- tracer/include/objs3.hxx | 13 - tracer/include/objs4.hxx | 13 - tracer/include/test.std | 0 tracer/include/test1.hxx | 18 -- tracer/include/test2.hxx | 17 -- tracer/include/test3.hxx | 14 - tracer/include/test4.hxx | 14 - tracer/makefile | 41 --- tracer/object/driver.cxx | 234 ----------------- tracer/object/makefile | 104 -------- tracer/object/test.hxx | 27 -- tracer/object/test.std | 108 -------- tracer/pragma/driver.cxx | 26 -- tracer/pragma/makefile | 104 -------- tracer/pragma/test.hxx | 42 --- tracer/pragma/test.std | 0 tracer/template/Makefile.am | 31 --- tracer/template/driver.cxx | 35 --- tracer/template/makefile | 104 -------- tracer/template/template-vc10.vcxproj | 180 ------------- tracer/template/template-vc10.vcxproj.filters | 25 -- tracer/template/template-vc9.vcproj | 361 -------------------------- tracer/template/test.hxx | 27 -- tracer/template/test.std | 3 - tracer/test.bat | 70 ----- tracer/tracer-vc10.sln | 15 -- tracer/tracer-vc9.sln | 15 -- tracer/transaction/driver.cxx | 92 ------- tracer/transaction/makefile | 87 ------- tracer/transaction/test.std | 21 -- tracer/types/driver.cxx | 35 --- tracer/types/makefile | 104 -------- tracer/types/test.hxx | 69 ----- tracer/types/test.std | 0 42 files changed, 2298 deletions(-) delete mode 100644 tracer/Makefile.am delete mode 100644 tracer/include/driver.cxx delete mode 100644 tracer/include/makefile delete mode 100644 tracer/include/obj1.hxx delete mode 100644 tracer/include/obj2.hxx delete mode 100644 tracer/include/obj3.hxx delete mode 100644 tracer/include/objs1.hxx delete mode 100644 tracer/include/objs2.hxx delete mode 100644 tracer/include/objs3.hxx delete mode 100644 tracer/include/objs4.hxx delete mode 100644 tracer/include/test.std delete mode 100644 tracer/include/test1.hxx delete mode 100644 tracer/include/test2.hxx delete mode 100644 tracer/include/test3.hxx delete mode 100644 tracer/include/test4.hxx delete mode 100644 tracer/makefile delete mode 100644 tracer/object/driver.cxx delete mode 100644 tracer/object/makefile delete mode 100644 tracer/object/test.hxx delete mode 100644 tracer/object/test.std delete mode 100644 tracer/pragma/driver.cxx delete mode 100644 tracer/pragma/makefile delete mode 100644 tracer/pragma/test.hxx delete mode 100644 tracer/pragma/test.std delete mode 100644 tracer/template/Makefile.am delete mode 100644 tracer/template/driver.cxx delete mode 100644 tracer/template/makefile delete mode 100644 tracer/template/template-vc10.vcxproj delete mode 100644 tracer/template/template-vc10.vcxproj.filters delete mode 100644 tracer/template/template-vc9.vcproj delete mode 100644 tracer/template/test.hxx delete mode 100644 tracer/template/test.std delete mode 100644 tracer/test.bat delete mode 100644 tracer/tracer-vc10.sln delete mode 100644 tracer/tracer-vc9.sln delete mode 100644 tracer/transaction/driver.cxx delete mode 100644 tracer/transaction/makefile delete mode 100644 tracer/transaction/test.std delete mode 100644 tracer/types/driver.cxx delete mode 100644 tracer/types/makefile delete mode 100644 tracer/types/test.hxx delete mode 100644 tracer/types/test.std (limited to 'tracer') diff --git a/tracer/Makefile.am b/tracer/Makefile.am deleted file mode 100644 index acaf926..0000000 --- a/tracer/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -# file : tracer/Makefile.am -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) -EXTRA_DIST = __file__(extra_dist) \ No newline at end of file diff --git a/tracer/include/driver.cxx b/tracer/include/driver.cxx deleted file mode 100644 index f2f9382..0000000 --- a/tracer/include/driver.cxx +++ /dev/null @@ -1,41 +0,0 @@ -// file : tracer/include/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// Test inclusion of -odb files (compilation test). -// -// The setup of this test is as follows: the ODB compiler has two -// additional include directories in its search path: .. and ../.. -// while the C++ compiler has only ../.. . This way, if a ..-based -// path is used in the generated code, the C++ compilation will -// fail. -// - -#include -#include -#include - -#include -#include -#include - -#include "test1.hxx" -#include "test1-odb.hxx" - -#include "test2.hxx" -#include "test2-odb.hxx" - -#include "test3.hxx" -#include "test3-odb.hxx" - -#include "test4.hxx" -#include "test4-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main () -{ -} diff --git a/tracer/include/makefile b/tracer/include/makefile deleted file mode 100644 index a7f7089..0000000 --- a/tracer/include/makefile +++ /dev/null @@ -1,90 +0,0 @@ -# file : tracer/include/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := obj1.hxx obj2.hxx obj3.hxx test1.hxx test2.hxx test3.hxx test4.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb/stub.make,\ - l: odb.l,cpp-options: odb.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libodb-tracer/stub.make,\ - l: odb_tracer.l,cpp-options: odb_tracer.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_tracer.l) $(odb.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) \ --I$(out_base)/../.. -I$(src_base)/../.. -$(cxx_obj) $(cxx_od): $(odb_tracer.l.cpp-options) $(odb.l.cpp-options) - -genf := $(foreach f,$(odb_hdr:.hxx=-odb),$(addprefix $f,.hxx .ixx .cxx)) -gen := $(addprefix $(out_base)/,$(genf)) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen): odb_options += --database tracer -$(gen): cpp_options := -I$(out_base) -I$(src_base)/.. -I$(src_base)/../.. -$(gen): $(odb_tracer.l.cpp-options) $(odb.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist: not supported. -# -$(dist): - -# Test. -# -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< >$(out_base)/test.out) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) - $(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,$(odb_rules)) -$(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/tracer/include/obj1.hxx b/tracer/include/obj1.hxx deleted file mode 100644 index ef2429b..0000000 --- a/tracer/include/obj1.hxx +++ /dev/null @@ -1,27 +0,0 @@ -// file : tracer/include/obj1.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef OBJ1_HXX -#define OBJ1_HXX - -#include - -#pragma db object -struct object1 -{ - object1 (unsigned long id) - : id_ (id) - { - } - - object1 () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // OBJ1_HXX diff --git a/tracer/include/obj2.hxx b/tracer/include/obj2.hxx deleted file mode 100644 index 71018a8..0000000 --- a/tracer/include/obj2.hxx +++ /dev/null @@ -1,27 +0,0 @@ -// file : tracer/include/obj2.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef OBJ2_HXX -#define OBJ2_HXX - -#include - -#pragma db object -struct object2 -{ - object2 (unsigned long id) - : id_ (id) - { - } - - object2 () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // OBJ2_HXX diff --git a/tracer/include/obj3.hxx b/tracer/include/obj3.hxx deleted file mode 100644 index 92bdc0b..0000000 --- a/tracer/include/obj3.hxx +++ /dev/null @@ -1,27 +0,0 @@ -// file : tracer/include/obj3.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef OBJ3_HXX -#define OBJ3_HXX - -#include - -#pragma db object -struct object3 -{ - object3 (unsigned long id) - : id_ (id) - { - } - - object3 () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // OBJ3_HXX diff --git a/tracer/include/objs1.hxx b/tracer/include/objs1.hxx deleted file mode 100644 index 98c0f2f..0000000 --- a/tracer/include/objs1.hxx +++ /dev/null @@ -1,15 +0,0 @@ -// file : tracer/include/objs1.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef OBJS1_HXX -#define OBJS1_HXX - -#ifdef ODB_COMPILER -# include -# include -# include -#endif - -#endif // OBJS1_HXX diff --git a/tracer/include/objs2.hxx b/tracer/include/objs2.hxx deleted file mode 100644 index c19811a..0000000 --- a/tracer/include/objs2.hxx +++ /dev/null @@ -1,15 +0,0 @@ -// file : tracer/include/objs2.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef OBJS2_HXX -#define OBJS2_HXX - -#ifdef ODB_COMPILER -# include "include/obj1.hxx" -# include "include/obj2.hxx" -# include "include/obj3.hxx" -#endif - -#endif // OBJS2_HXX diff --git a/tracer/include/objs3.hxx b/tracer/include/objs3.hxx deleted file mode 100644 index b8828de..0000000 --- a/tracer/include/objs3.hxx +++ /dev/null @@ -1,13 +0,0 @@ -// file : tracer/include/objs3.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef OBJS3_HXX -#define OBJS3_HXX - -#include "../include/obj1.hxx" -#include "../include/obj2.hxx" -#include "../include/obj3.hxx" - -#endif // OBJS3_HXX diff --git a/tracer/include/objs4.hxx b/tracer/include/objs4.hxx deleted file mode 100644 index 7f76aea..0000000 --- a/tracer/include/objs4.hxx +++ /dev/null @@ -1,13 +0,0 @@ -// file : tracer/include/objs1.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef OBJS4_HXX -#define OBJS4_HXX - -#include -#include -#include - -#endif // OBJS4_HXX diff --git a/tracer/include/test.std b/tracer/include/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/tracer/include/test1.hxx b/tracer/include/test1.hxx deleted file mode 100644 index 6f08900..0000000 --- a/tracer/include/test1.hxx +++ /dev/null @@ -1,18 +0,0 @@ -// file : tracer/include/test1.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST1_HXX -#define TEST1_HXX - -// Test include directive parsing. -// -#include"obj1.hxx" - - # include \ - - -/*comment*/ # /*comment*/ include /* comment */ "obj3.hxx" // comment - -#endif // TEST1_HXX diff --git a/tracer/include/test2.hxx b/tracer/include/test2.hxx deleted file mode 100644 index 74623d4..0000000 --- a/tracer/include/test2.hxx +++ /dev/null @@ -1,17 +0,0 @@ -// file : tracer/include/test2.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -// Test preference of includes from the main file. -// -#include "objs1.hxx" - -#include "obj1.hxx" -#include "obj2.hxx" -#include "obj3.hxx" - -#endif // TEST2_HXX diff --git a/tracer/include/test3.hxx b/tracer/include/test3.hxx deleted file mode 100644 index 3f1b762..0000000 --- a/tracer/include/test3.hxx +++ /dev/null @@ -1,14 +0,0 @@ -// file : tracer/include/test3.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST3_HXX -#define TEST3_HXX - -// Test preference of longer (more qualified) paths. -// -#include "objs2.hxx" -#include "objs3.hxx" - -#endif // TEST3_HXX diff --git a/tracer/include/test4.hxx b/tracer/include/test4.hxx deleted file mode 100644 index 8ea681a..0000000 --- a/tracer/include/test4.hxx +++ /dev/null @@ -1,14 +0,0 @@ -// file : tracer/include/test3.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST3_HXX -#define TEST3_HXX - -// Test preference of <> over "". -// -#include "objs2.hxx" -#include "objs4.hxx" - -#endif // TEST3_HXX diff --git a/tracer/makefile b/tracer/makefile deleted file mode 100644 index e566c59..0000000 --- a/tracer/makefile +++ /dev/null @@ -1,41 +0,0 @@ -# file : tracer/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make - -tests := \ -template \ -object \ -include \ -pragma \ -transaction \ -types - -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) - -$(dist): name := tracer -$(dist): export dirs := $(filter-out include,$(tests)) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln test.bat -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) - $(call meta-automake) - $(call meta-vc9sln,$(name)-vc9.sln) - $(call meta-vc10sln,$(name)-vc10.sln) - $(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/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.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/tracer/object/driver.cxx b/tracer/object/driver.cxx deleted file mode 100644 index 4ea6329..0000000 --- a/tracer/object/driver.cxx +++ /dev/null @@ -1,234 +0,0 @@ -// file : tracer/object/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// Test object persistence operations. -// - -#include -#include -#include - -#include -#include -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main () -{ - odb::tracer::database db; - - // database operation out of transaction - // - cout << "\ntest 001" << endl; - { - object o1 (1); - try - { - cout << "s 1" << endl; - db.persist (o1); - cout << "s 2.a" << endl; - } - catch (const not_in_transaction&) - { - cout << "s 2.b" << endl; - } - } - - // transient -> persistent - // - cout << "\ntest 002" << endl; - { - object o1 (1); - transaction t (db.begin ()); - cout << "s 1" << endl; - db.persist (o1); - cout << "s 2" << endl; - t.commit (); - cout << "s 3" << endl; - } - - // transient -> persistent (already exist) - // - cout << "\ntest 003" << endl; - { - object o1 (0); - transaction t (db.begin ()); - cout << "s 1" << endl; - try - { - db.persist (o1); - } - catch (const object_already_persistent&) - { - cout << "object already persistent" << endl; - } - cout << "s 2" << endl; - } - - // persistent -> transient - // - cout << "\ntest 004" << endl; - { - object o1 (1); - object o2 (2); - transaction t (db.begin ()); - cout << "s 1" << endl; - db.persist (o1); - db.persist (o2); - cout << "s 2" << endl; - db.erase (o1); - db.erase (2); - cout << "s 3" << endl; - t.commit (); - cout << "s 4" << endl; - } - - // persistent -> transient (not exist) - // - cout << "\ntest 005" << endl; - { - object o1 (0); - transaction t (db.begin ()); - cout << "s 1" << endl; - try - { - db.erase (o1); - } - catch (const object_not_persistent&) - { - cout << "object not persistent" << endl; - } - cout << "s 2" << endl; - } - - // load new object - // - cout << "\ntest 006" << endl; - { - transaction t (db.begin ()); - cout << "s 1" << endl; - auto_ptr o1 (db.load (1)); - cout << "s 2" << endl; - t.commit (); - cout << "s 3" << endl; - } - - // load new object (not exist) - // - cout << "\ntest 007" << endl; - { - transaction t (db.begin ()); - cout << "s 1" << endl; - try - { - auto_ptr o1 (db.load (0)); - } - catch (const object_not_persistent&) - { - cout << "object not persistent" << endl; - } - cout << "s 2" << endl; - } - - // load into existing object - // - cout << "\ntest 008" << endl; - { - object o1; - transaction t (db.begin ()); - cout << "s 1" << endl; - db.load (1, o1); - cout << "s 2" << endl; - t.commit (); - cout << "s 3" << endl; - } - - // load into existing object (not exist) - // - cout << "\ntest 009" << endl; - { - object o1; - transaction t (db.begin ()); - cout << "s 1" << endl; - try - { - db.load (0, o1); - } - catch (const object_not_persistent&) - { - cout << "object not persistent" << endl; - } - cout << "s 2" << endl; - } - - // update - // - cout << "\ntest 010" << endl; - { - transaction t (db.begin ()); - cout << "s 1" << endl; - auto_ptr o1 (db.load (1)); - cout << "s 2" << endl; - db.update (*o1); - cout << "s 3" << endl; - t.commit (); - cout << "s 4" << endl; - } - - // update (not exist) - // - cout << "\ntest 011" << endl; - { - object o1 (0); - transaction t (db.begin ()); - cout << "s 1" << endl; - try - { - db.update (o1); - } - catch (const object_not_persistent&) - { - cout << "object not persistent" << endl; - } - cout << "s 2" << endl; - } - - // find new object - // - cout << "\ntest 012" << endl; - { - transaction t (db.begin ()); - cout << "s 1" << endl; - auto_ptr o1 (db.find (1)); - assert (o1.get () != 0); - auto_ptr o2 (db.find (0)); - assert (o2.get () == 0); - cout << "s 2" << endl; - t.commit (); - cout << "s 3" << endl; - } - - // load into existing object - // - cout << "\ntest 013" << endl; - { - object o1; - transaction t (db.begin ()); - cout << "s 1" << endl; - bool r (db.find (1, o1)); - assert (r); - r = db.find (0, o1); - assert (!r); - cout << "s 2" << endl; - t.commit (); - cout << "s 3" << endl; - } -} diff --git a/tracer/object/makefile b/tracer/object/makefile deleted file mode 100644 index bd0efca..0000000 --- a/tracer/object/makefile +++ /dev/null @@ -1,104 +0,0 @@ -# file : tracer/object/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb/stub.make,\ - l: odb.l,cpp-options: odb.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libodb-tracer/stub.make,\ - l: odb_tracer.l,cpp-options: odb_tracer.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_tracer.l) $(odb.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(odb_tracer.l.cpp-options) $(odb.l.cpp-options) - -genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) -gen := $(addprefix $(out_base)/,$(genf)) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database tracer -$(gen): cpp_options := -I$(src_base) -$(gen): $(odb_tracer.l.cpp-options) $(odb.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)/tracer/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - -# Test. -# -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< >$(out_base)/test.out) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) - $(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/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(odb_rules)) -$(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/tracer/object/test.hxx b/tracer/object/test.hxx deleted file mode 100644 index 38bbd7f..0000000 --- a/tracer/object/test.hxx +++ /dev/null @@ -1,27 +0,0 @@ -// file : tracer/object/test.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// 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/tracer/object/test.std b/tracer/object/test.std deleted file mode 100644 index aa495e7..0000000 --- a/tracer/object/test.std +++ /dev/null @@ -1,108 +0,0 @@ - -test 001 -s 1 -s 2.b - -test 002 -begin transaction -s 1 -insert ::object id 1 -s 2 -commit transaction -s 3 - -test 003 -begin transaction -s 1 -insert ::object id 0 -object already persistent -s 2 -rollback transaction - -test 004 -begin transaction -s 1 -insert ::object id 1 -insert ::object id 2 -s 2 -delete ::object id 1 -delete ::object id 2 -s 3 -commit transaction -s 4 - -test 005 -begin transaction -s 1 -delete ::object id 0 -object not persistent -s 2 -rollback transaction - -test 006 -begin transaction -s 1 -select ::object id 1 -s 2 -commit transaction -s 3 - -test 007 -begin transaction -s 1 -select ::object id 0 -object not persistent -s 2 -rollback transaction - -test 008 -begin transaction -s 1 -select ::object id 1 -s 2 -commit transaction -s 3 - -test 009 -begin transaction -s 1 -select ::object id 0 -object not persistent -s 2 -rollback transaction - -test 010 -begin transaction -s 1 -select ::object id 1 -s 2 -update ::object id 1 -s 3 -commit transaction -s 4 - -test 011 -begin transaction -s 1 -update ::object id 0 -object not persistent -s 2 -rollback transaction - -test 012 -begin transaction -s 1 -select ::object id 1 -select ::object id 0 -s 2 -commit transaction -s 3 - -test 013 -begin transaction -s 1 -select ::object id 1 -select ::object id 0 -s 2 -commit transaction -s 3 diff --git a/tracer/pragma/driver.cxx b/tracer/pragma/driver.cxx deleted file mode 100644 index 2f89ad5..0000000 --- a/tracer/pragma/driver.cxx +++ /dev/null @@ -1,26 +0,0 @@ -// file : tracer/pragma/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// Test #pragma db parsing. -// - -#include -#include -#include - -#include -#include -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main () -{ -} diff --git a/tracer/pragma/makefile b/tracer/pragma/makefile deleted file mode 100644 index 688c6e1..0000000 --- a/tracer/pragma/makefile +++ /dev/null @@ -1,104 +0,0 @@ -# file : tracer/pragma/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb/stub.make,\ - l: odb.l,cpp-options: odb.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libodb-tracer/stub.make,\ - l: odb_tracer.l,cpp-options: odb_tracer.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_tracer.l) $(odb.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(odb_tracer.l.cpp-options) $(odb.l.cpp-options) - -genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) -gen := $(addprefix $(out_base)/,$(genf)) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database tracer -$(gen): cpp_options := -I$(src_base) -$(gen): $(odb_tracer.l.cpp-options) $(odb.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)/tracer/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - -# Test. -# -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< >$(out_base)/test.out) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) - $(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/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(odb_rules)) -$(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/tracer/pragma/test.hxx b/tracer/pragma/test.hxx deleted file mode 100644 index 46f251e..0000000 --- a/tracer/pragma/test.hxx +++ /dev/null @@ -1,42 +0,0 @@ -// file : tracer/template/test.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#pragma db value(bool) type ("INT") - -struct x {int i;}; -#pragma db value (x) - -namespace N -{ - #pragma db object - struct object1 - { - object1 () {} - - #pragma db id - unsigned long id_; - - #pragma db member type ("INT") - bool b_; - }; - - struct object2 - { - object2 () {} - - unsigned long id_; - }; - - #pragma db object (object2) -} - -PRAGMA_DB (member (N::object2::id_) id auto); - -#endif // TEST_HXX diff --git a/tracer/pragma/test.std b/tracer/pragma/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/tracer/template/Makefile.am b/tracer/template/Makefile.am deleted file mode 100644 index 4305788..0000000 --- a/tracer/template/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -# file : tracer/template/Makefile.am -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# 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) -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; - -m4_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@ - -test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< -) diff --git a/tracer/template/driver.cxx b/tracer/template/driver.cxx deleted file mode 100644 index e63fae6..0000000 --- a/tracer/template/driver.cxx +++ /dev/null @@ -1,35 +0,0 @@ -// file : tracer/template/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// PLACE TEST DESCRIPTION HERE -// - -#include -#include -#include - -#include -#include -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main () -{ - odb::tracer::database db; - - // - // - cout << "test 001" << endl; - { - transaction t (db.begin ()); - t.commit (); - } -} diff --git a/tracer/template/makefile b/tracer/template/makefile deleted file mode 100644 index e527f3d..0000000 --- a/tracer/template/makefile +++ /dev/null @@ -1,104 +0,0 @@ -# file : tracer/template/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb/stub.make,\ - l: odb.l,cpp-options: odb.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libodb-tracer/stub.make,\ - l: odb_tracer.l,cpp-options: odb_tracer.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_tracer.l) $(odb.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(odb_tracer.l.cpp-options) $(odb.l.cpp-options) - -genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) -gen := $(addprefix $(out_base)/,$(genf)) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database tracer -$(gen): cpp_options := -I$(src_base) -$(gen): $(odb_tracer.l.cpp-options) $(odb.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)/tracer/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - -# Test. -# -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< >$(out_base)/test.out) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) - $(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/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(odb_rules)) -$(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/tracer/template/template-vc10.vcxproj b/tracer/template/template-vc10.vcxproj deleted file mode 100644 index 1bcb4ac..0000000 --- a/tracer/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) - - - odb-tracer-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) - - - odb-tracer-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) - - - odb-tracer.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) - - - odb-tracer.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -m4_ifelse(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -m4_ifelse(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/tracer/template/template-vc10.vcxproj.filters b/tracer/template/template-vc10.vcxproj.filters deleted file mode 100644 index 951015b..0000000 --- a/tracer/template/template-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -m4_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) -m4_ifelse(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/tracer/template/template-vc9.vcproj b/tracer/template/template-vc9.vcproj deleted file mode 100644 index 8e52acb..0000000 --- a/tracer/template/template-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -m4_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 -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/tracer/template/test.hxx b/tracer/template/test.hxx deleted file mode 100644 index 93b7b93..0000000 --- a/tracer/template/test.hxx +++ /dev/null @@ -1,27 +0,0 @@ -// file : tracer/template/test.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// 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/tracer/template/test.std b/tracer/template/test.std deleted file mode 100644 index ac654fc..0000000 --- a/tracer/template/test.std +++ /dev/null @@ -1,3 +0,0 @@ -test 001 -begin transaction -commit transaction diff --git a/tracer/test.bat b/tracer/test.bat deleted file mode 100644 index fcae726..0000000 --- a/tracer/test.bat +++ /dev/null @@ -1,70 +0,0 @@ -@echo off -rem file : tracer/test.bat -rem author : Boris Kolpackov -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -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 tracer %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/tracer/tracer-vc10.sln b/tracer/tracer-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/tracer/tracer-vc10.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/tracer/tracer-vc9.sln b/tracer/tracer-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/tracer/tracer-vc9.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/tracer/transaction/driver.cxx b/tracer/transaction/driver.cxx deleted file mode 100644 index e1c7849..0000000 --- a/tracer/transaction/driver.cxx +++ /dev/null @@ -1,92 +0,0 @@ -// file : tracer/transaction/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// Test transaction operations. -// - -#include -#include - -#include -#include -#include -#include - -using namespace std; -using namespace odb::core; -namespace tracer = odb::tracer; - -int -main () -{ - tracer::database db; - - assert (!transaction::has_current ()); - - // Current and db accessors. - // - cout << "test 001" << endl; - { - transaction t (db.begin ()); - assert (&t.database () == &db); - assert (transaction::has_current ()); - assert (&transaction::current () == &t); - transaction::reset_current (); - assert (!transaction::has_current ()); - transaction t2 (db.begin (), false); - assert (!transaction::has_current ()); - transaction::current (t2); - assert (&transaction::current () == &t2); - } - - // Commit. - // - cout << "test 002" << endl; - { - transaction t (db.begin ()); - t.commit (); - } - - // Rollback. - // - cout << "test 003" << endl; - { - transaction t (db.begin ()); - t.rollback (); - } - - // Auto rollback. - // - cout << "test 004" << endl; - { - transaction t (db.begin ()); - } - - // Nested transaction. - // - cout << "test 005" << endl; - { - transaction t (db.begin ()); - try - { - transaction n (db.begin ()); - } - catch (const already_in_transaction&) - { - cout << "already_in_transaction" << endl; - } - } - - // Concrete transaction type. - // - cout << "test 006" << endl; - { - assert (sizeof (tracer::transaction) == sizeof (transaction)); - - tracer::transaction t (db.begin ()); - tracer::transaction& r (tracer::transaction::current ()); - assert (&t == &r); - } -} diff --git a/tracer/transaction/makefile b/tracer/transaction/makefile deleted file mode 100644 index 5cc6ef5..0000000 --- a/tracer/transaction/makefile +++ /dev/null @@ -1,87 +0,0 @@ -# file : tracer/transaction/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# 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) - -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - -# Import. -# -$(call import,\ - $(scf_root)/import/libodb/stub.make,\ - l: odb.l,cpp-options: odb.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libodb-tracer/stub.make,\ - l: odb_tracer.l,cpp-options: odb_tracer.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_tracer.l) $(odb.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(odb_tracer.l.cpp-options) $(odb.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)/tracer/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - -# Test. -# -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< >$(out_base)/test.out) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) - -# 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/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.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/tracer/transaction/test.std b/tracer/transaction/test.std deleted file mode 100644 index 792010c..0000000 --- a/tracer/transaction/test.std +++ /dev/null @@ -1,21 +0,0 @@ -test 001 -begin transaction -begin transaction -rollback transaction -rollback transaction -test 002 -begin transaction -commit transaction -test 003 -begin transaction -rollback transaction -test 004 -begin transaction -rollback transaction -test 005 -begin transaction -already_in_transaction -rollback transaction -test 006 -begin transaction -rollback transaction diff --git a/tracer/types/driver.cxx b/tracer/types/driver.cxx deleted file mode 100644 index 9c1b97d..0000000 --- a/tracer/types/driver.cxx +++ /dev/null @@ -1,35 +0,0 @@ -// file : tracer/types/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// Test C++ type handling (anonymous types, aliasing). -// - -#include -#include -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -template -struct same_p -{ - static const bool result = false; -}; - -template -struct same_p -{ - static const bool result = true; -}; - -int -main () -{ - assert ((same_p::id_type, int>::result)); -} diff --git a/tracer/types/makefile b/tracer/types/makefile deleted file mode 100644 index 2a7ceb5..0000000 --- a/tracer/types/makefile +++ /dev/null @@ -1,104 +0,0 @@ -# file : tracer/types/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb/stub.make,\ - l: odb.l,cpp-options: odb.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libodb-tracer/stub.make,\ - l: odb_tracer.l,cpp-options: odb_tracer.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_tracer.l) $(odb.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(odb_tracer.l.cpp-options) $(odb.l.cpp-options) - -genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) -gen := $(addprefix $(out_base)/,$(genf)) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database tracer -$(gen): cpp_options := -I$(src_base) -$(gen): $(odb_tracer.l.cpp-options) $(odb.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)/tracer/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - -# Test. -# -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< >$(out_base)/test.out) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) - $(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/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(odb_rules)) -$(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/tracer/types/test.hxx b/tracer/types/test.hxx deleted file mode 100644 index c37692b..0000000 --- a/tracer/types/test.hxx +++ /dev/null @@ -1,69 +0,0 @@ -// file : tracer/types/test.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#ifdef ODB_COMPILER -typedef int int_t; -typedef short num_t; -#else -typedef int num_t; -#endif - -typedef num_t num_type; - -#pragma db object -struct object1 -{ - typedef int int_type; - - #pragma db id - int_type id_; -}; - -#pragma db object -struct object2 -{ - #pragma db id - num_type num_; -}; - -// Template-id with "inner" name (compilation test). -// -template -struct num_wrap -{ -#ifdef ODB_COMPILER - typedef num_wrap this_type; -#endif - - X v_; -}; - -template -std::ostream& -operator<< (std::ostream& os, const num_wrap& x) -{ - return os << x.v_; -} - -template -bool -operator== (const num_wrap& x, const num_wrap& y) -{ - return x.v_ == y.v_; -} - -#pragma db object -struct object3 -{ - #pragma db id - num_wrap num_; -}; - -#endif // TEST_HXX diff --git a/tracer/types/test.std b/tracer/types/test.std deleted file mode 100644 index e69de29..0000000 -- cgit v1.1