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. --- INSTALL | 43 ++- Makefile.am | 2 +- build.bat | 8 - build/import/libodb-tracer/LICENSE | 12 - .../import/libodb-tracer/configuration-rules.make | 15 - build/import/libodb-tracer/configure | 55 ---- build/import/libodb-tracer/stub.make | 30 -- common/include/driver.cxx | 42 +++ common/include/makefile | 91 ++++++ common/include/obj1.hxx | 27 ++ common/include/obj2.hxx | 27 ++ common/include/obj3.hxx | 27 ++ common/include/objs1.hxx | 15 + common/include/objs2.hxx | 15 + common/include/objs3.hxx | 13 + common/include/objs4.hxx | 13 + common/include/test.std | 0 common/include/test1.hxx | 18 + common/include/test2.hxx | 17 + common/include/test3.hxx | 14 + common/include/test4.hxx | 14 + common/lifecycle/driver.cxx | 124 +++++++ common/makefile | 3 + common/pragma/driver.cxx | 27 ++ common/pragma/makefile | 108 ++++++ common/pragma/test.hxx | 42 +++ common/pragma/test.std | 0 common/types/driver.cxx | 37 +++ common/types/makefile | 107 ++++++ common/types/test.hxx | 57 ++++ common/types/test.std | 0 configure.ac | 3 +- m4/libodb-tracer.m4 | 84 ----- makefile | 10 +- test.bat | 2 +- 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 77 files changed, 867 insertions(+), 2533 deletions(-) delete mode 100644 build/import/libodb-tracer/LICENSE delete mode 100644 build/import/libodb-tracer/configuration-rules.make delete mode 100755 build/import/libodb-tracer/configure delete mode 100644 build/import/libodb-tracer/stub.make create mode 100644 common/include/driver.cxx create mode 100644 common/include/makefile create mode 100644 common/include/obj1.hxx create mode 100644 common/include/obj2.hxx create mode 100644 common/include/obj3.hxx create mode 100644 common/include/objs1.hxx create mode 100644 common/include/objs2.hxx create mode 100644 common/include/objs3.hxx create mode 100644 common/include/objs4.hxx create mode 100644 common/include/test.std create mode 100644 common/include/test1.hxx create mode 100644 common/include/test2.hxx create mode 100644 common/include/test3.hxx create mode 100644 common/include/test4.hxx create mode 100644 common/pragma/driver.cxx create mode 100644 common/pragma/makefile create mode 100644 common/pragma/test.hxx create mode 100644 common/pragma/test.std create mode 100644 common/types/driver.cxx create mode 100644 common/types/makefile create mode 100644 common/types/test.hxx create mode 100644 common/types/test.std delete mode 100644 m4/libodb-tracer.m4 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 diff --git a/INSTALL b/INSTALL index 7d87da3..2f98f9c 100644 --- a/INSTALL +++ b/INSTALL @@ -12,7 +12,6 @@ Prerequisites Required: - odb http://www.codesynthesis.com/products/odb/ - libodb http://www.codesynthesis.com/products/odb/ - - libodb-tracer http://www.codesynthesis.com/products/odb/ - libodb- http://www.codesynthesis.com/products/odb/ Optional: @@ -55,19 +54,19 @@ option to specify the build directory, for example: ./configure --with-odb=/tmp/odb -The configure script also expects the libodb, libodb-tracer, and -libodb- headers and libraries to be installed in a directory -where the C++ compiler and linker will search for them by default (normally -/usr and /usr/local). If these libraries are installed in other directories, -you can use the CPPFLAGS and LDFLAGS configure variables to specify their -locations, for example: +The configure script also expects the libodb and libodb- headers +and libraries to be installed in a directory where the C++ compiler and +linker will search for them by default (normally /usr and /usr/local). +If these libraries are installed in other directories, you can use the +CPPFLAGS and LDFLAGS configure variables to specify their locations, for +example: ./configure CPPFLAGS=-I/opt/libodb/include LDFLAGS=-L/opt/libodb/lib If these libraries are not installed and you would like to use their -build directories instead, you can use the --with-libodb, ---with-libodb-tracer, and --with-libodb- configure options -to specify their locations, for example: +build directories instead, you can use the --with-libodb, and +--with-libodb- configure options to specify their locations, +for example: ./configure --with-libodb=/tmp/libodb @@ -110,8 +109,8 @@ Cygwin or MinGW, refer to the "Building on UNIX" section above. The standard Visual Studio project and solution files are used on this platform. The provided project files expect the directory where the ODB compiler binary is installed to be in the executable search path (the -PATH environment variable). They also expect the libodb, libodb-tracer, -and libodb- header and import library directories to be in the +PATH environment variable). They also expect the libodb and +libodb- header and import library directories to be in the VC++ Directories Include and Library search lists. See the INSTALL files in the ODB library packages for more information on how to setup their VC++ Directories. @@ -127,13 +126,13 @@ Qt, refer to their documentation. There are two ways to build the tests with Visual Studio. After unpacking the source code archive, you can manually open solution files located in -the tracer\, common\, \, boost\common\, boost\\, +the libcommon\, common\, \, boost\common\, boost\\, qt\common\, and qt\\ directories in the odb-tests package -directory (referred to as odb-tests\ from now on). In the tracer\ directory -the solution file is named tracer-vc.sln. In the common\, boost\common\, -and qt\common\ directories they are named common--vc.sln. And -in the \, boost\\, and qt\ directories they -are named -vc.sln. Here is the version of Visual Studio +directory (referred to as odb-tests\ from now on). In the libcommon\, +common\, boost\common\, and qt\common\ directories the solutions are +named in the form name--vc.sln. And in the \, +boost\\, and qt\\ directories they are named in +the form -vc.sln. Here is the version of Visual Studio that you are using. Once each solution is open, select the desired build configuration (Debug or Release) and platform (Win32 or x64) and build the solution. @@ -147,10 +146,10 @@ build.bat [/Build|/Clean|/Rebuild] Where is the version of Visual Studio that you are using, is the desired configuration (e.g., Debug or Release), and is the desired -platform (e.g., Win32 or x64). For and arguments you can specify -several configurations or platforms. You can also use the 'all' value to build -all configurations and/or all platforms. If no action is specified, the -default is /Build. +platform (e.g., Win32 or x64). For and arguments you can +specify several configurations or platforms. You can also use the 'all' +value to build all configurations and/or all platforms. If no action is +specified, the default is /Build. Once the build is completed successfully, you can run all the tests using the test.bat batch file located in the odb-tests\ directory. diff --git a/Makefile.am b/Makefile.am index 09198da..9c56178 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file -SUBDIRS = libcommon tracer common +SUBDIRS = libcommon common if ODB_TESTS_BOOST SUBDIRS += boost diff --git a/build.bat b/build.bat index 23607c1..7ec749d 100644 --- a/build.bat +++ b/build.bat @@ -79,14 +79,6 @@ for %%c in (%confs%) do ( ) ) -for %%d in (tracer %1) do ( - for %%c in (%confs%) do ( - for %%p in (%plats%) do ( - call :run_build %%d/%%d-vc%vcver%.sln %%c %%p - ) - ) -) - for %%c in (%confs%) do ( for %%p in (%plats%) do ( call :run_build common/common-%1-vc%vcver%.sln %%c %%p diff --git a/build/import/libodb-tracer/LICENSE b/build/import/libodb-tracer/LICENSE deleted file mode 100644 index ed9c55c..0000000 --- a/build/import/libodb-tracer/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License version 2 as -published by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA diff --git a/build/import/libodb-tracer/configuration-rules.make b/build/import/libodb-tracer/configuration-rules.make deleted file mode 100644 index 2780987..0000000 --- a/build/import/libodb-tracer/configuration-rules.make +++ /dev/null @@ -1,15 +0,0 @@ -# file : build/import/libodb-tracer/configuration-rules.make -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : GNU GPL v2; see accompanying LICENSE file - -$(dcf_root)/import/libodb-tracer/configuration-dynamic.make: | $(dcf_root)/import/libodb-tracer/. - $(call message,,$(scf_root)/import/libodb-tracer/configure $@) - -ifndef %foreign% - -$(dcf_root)/.disfigure:: - $(call message,rm $(dcf_root)/import/libodb-tracer/configuration-dynamic.make,\ -rm -f $(dcf_root)/import/libodb-tracer/configuration-dynamic.make) - -endif diff --git a/build/import/libodb-tracer/configure b/build/import/libodb-tracer/configure deleted file mode 100755 index 644b804..0000000 --- a/build/import/libodb-tracer/configure +++ /dev/null @@ -1,55 +0,0 @@ -#! /usr/bin/env bash - -# file : build/import/libodb-tracer/configure -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : GNU GPL v2; see accompanying LICENSE file - - -# $1 - out file -# -# bld_root - build root -# project_name - project name -# - -source $bld_root/dialog.bash - - -$echo -$echo "Configuring external dependency on 'libodb-tracer' for '$project_name'." -$echo - -$echo -$echo "Would you like to configure dependency on the installed version" -$echo "of 'libodb-tracer' as opposed to the development build?" -$echo - -installed=`read_y_n y` - -path= - -if [ "$installed" = "n" ]; then - -$echo -$echo "Please enter the src_root for 'libodb-tracer'." -$echo - -src_root=`read_path --directory --exist` - -$echo -$echo "Please enter the out_root for 'libodb-tracer'." -$echo - -out_root=`read_path --directory $src_root` - -fi - -echo libodb_tracer_installed := $installed >$1 - -if [ "$installed" = "n" ]; then - -echo src_root := $src_root >>$1 -echo scf_root := \$\(src_root\)/build >>$1 -echo out_root := $out_root >>$1 - -fi diff --git a/build/import/libodb-tracer/stub.make b/build/import/libodb-tracer/stub.make deleted file mode 100644 index 8d4bb96..0000000 --- a/build/import/libodb-tracer/stub.make +++ /dev/null @@ -1,30 +0,0 @@ -# file : build/import/libodb-tracer/stub.make -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : GNU GPL v2; see accompanying LICENSE file - -$(call include-once,$(scf_root)/import/libodb-tracer/configuration-rules.make,$(dcf_root)) - -libodb_tracer_installed := - -$(call -include,$(dcf_root)/import/libodb-tracer/configuration-dynamic.make) - -ifdef libodb_tracer_installed - -ifeq ($(libodb_tracer_installed),y) - -$(call export,l: -lodb-tracer -lodb,cpp-options: ) - -else - -# Include export stub. -# -$(call include,$(scf_root)/export/libodb-tracer/stub.make) - -endif - -else - -.NOTPARALLEL: - -endif diff --git a/common/include/driver.cxx b/common/include/driver.cxx new file mode 100644 index 0000000..d588a62 --- /dev/null +++ b/common/include/driver.cxx @@ -0,0 +1,42 @@ +// file : common/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/common/include/makefile b/common/include/makefile new file mode 100644 index 0000000..7053d75 --- /dev/null +++ b/common/include/makefile @@ -0,0 +1,91 @@ +# file : common/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) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +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) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) \ +-I$(out_base)/../.. -I$(src_base)/../.. +$(cxx_obj) $(cxx_od): $(common.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) $(dist): export odb_options += --database $(db_id) \ +--table-prefix include_ +$(gen): cpp_options := -I$(out_base) -I$(src_base)/.. -I$(src_base)/../.. +$(gen): $(common.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 $<,$< --options-file $(dcf_root)/db.options \ +>$(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) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/include/obj1.hxx b/common/include/obj1.hxx new file mode 100644 index 0000000..cdf6a66 --- /dev/null +++ b/common/include/obj1.hxx @@ -0,0 +1,27 @@ +// file : common/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/common/include/obj2.hxx b/common/include/obj2.hxx new file mode 100644 index 0000000..4c98d7d --- /dev/null +++ b/common/include/obj2.hxx @@ -0,0 +1,27 @@ +// file : common/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/common/include/obj3.hxx b/common/include/obj3.hxx new file mode 100644 index 0000000..b73673a --- /dev/null +++ b/common/include/obj3.hxx @@ -0,0 +1,27 @@ +// file : common/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/common/include/objs1.hxx b/common/include/objs1.hxx new file mode 100644 index 0000000..5e592a4 --- /dev/null +++ b/common/include/objs1.hxx @@ -0,0 +1,15 @@ +// file : common/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/common/include/objs2.hxx b/common/include/objs2.hxx new file mode 100644 index 0000000..f2cfee0 --- /dev/null +++ b/common/include/objs2.hxx @@ -0,0 +1,15 @@ +// file : common/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/common/include/objs3.hxx b/common/include/objs3.hxx new file mode 100644 index 0000000..d9bc01a --- /dev/null +++ b/common/include/objs3.hxx @@ -0,0 +1,13 @@ +// file : common/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/common/include/objs4.hxx b/common/include/objs4.hxx new file mode 100644 index 0000000..fc5f1de --- /dev/null +++ b/common/include/objs4.hxx @@ -0,0 +1,13 @@ +// file : common/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/common/include/test.std b/common/include/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/include/test1.hxx b/common/include/test1.hxx new file mode 100644 index 0000000..15972c1 --- /dev/null +++ b/common/include/test1.hxx @@ -0,0 +1,18 @@ +// file : common/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/common/include/test2.hxx b/common/include/test2.hxx new file mode 100644 index 0000000..ee26994 --- /dev/null +++ b/common/include/test2.hxx @@ -0,0 +1,17 @@ +// file : common/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/common/include/test3.hxx b/common/include/test3.hxx new file mode 100644 index 0000000..a2b2096 --- /dev/null +++ b/common/include/test3.hxx @@ -0,0 +1,14 @@ +// file : common/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/common/include/test4.hxx b/common/include/test4.hxx new file mode 100644 index 0000000..49180bc --- /dev/null +++ b/common/include/test4.hxx @@ -0,0 +1,14 @@ +// file : common/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/common/lifecycle/driver.cxx b/common/lifecycle/driver.cxx index 46d145b..8323694 100644 --- a/common/lifecycle/driver.cxx +++ b/common/lifecycle/driver.cxx @@ -28,6 +28,18 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); + // Database operation out of transaction. + // + try + { + object o (1); + db->persist (o); + assert (false); + } + catch (const not_in_transaction&) + { + } + // Transient. // try @@ -63,11 +75,100 @@ main (int argc, char* argv[]) } } + // Find. + // + { + transaction t (db->begin ()); + + auto_ptr o1 (db->find (1)); + assert (o1.get () != 0 && o1->str_ == "value 1"); + + auto_ptr o2 (db->find (2)); + assert (o2.get () == 0); + + t.commit (); + } + + // Find (into existing). + // + { + object o; + + transaction t (db->begin ()); + + assert (db->find (1, o)); + assert (o.str_ == "value 1"); + + assert (!db->find (2, o)); + + t.commit (); + } + + // Load. + // { transaction t (db->begin ()); auto_ptr o (db->load (1)); assert (o->str_ == "value 1"); t.commit (); + + try + { + transaction t (db->begin ()); + auto_ptr o (db->load (2)); + assert (false); + t.commit (); + } + catch (const object_not_persistent&) + { + } + } + + // Load (into existing). + // + { + object o; + + transaction t (db->begin ()); + db->load (1, o); + assert (o.str_ == "value 1"); + t.commit (); + + try + { + transaction t (db->begin ()); + db->load (2, o); + assert (false); + t.commit (); + } + catch (const object_not_persistent&) + { + } + } + + // Reload. + // + { + object o; + + transaction t (db->begin ()); + db->load (1, o); + o.str_ = "junk"; + db->reload (o); + assert (o.str_ == "value 1"); + t.commit (); + + try + { + transaction t (db->begin ()); + o.id_ = 2; + db->reload (o); + assert (false); + t.commit (); + } + catch (const object_not_persistent&) + { + } } // Modified. @@ -78,6 +179,18 @@ main (int argc, char* argv[]) o->str_ = "value 2"; db->update (*o); t.commit (); + + try + { + transaction t (db->begin ()); + o->id_ = 2; + db->update (*o); + assert (false); + t.commit (); + } + catch (const object_not_persistent&) + { + } } { @@ -103,6 +216,17 @@ main (int argc, char* argv[]) auto_ptr o (db->load (1)); db->erase (*o); t.commit (); + + try + { + transaction t (db->begin ()); + db->erase (1); + assert (false); + t.commit (); + } + catch (const object_not_persistent&) + { + } } try diff --git a/common/makefile b/common/makefile index 37d50d3..c75ea56 100644 --- a/common/makefile +++ b/common/makefile @@ -17,18 +17,21 @@ ctor \ default \ enum \ erase-query \ +include \ inheritance \ inverse \ lazy-ptr \ lifecycle \ no-id \ optimistic \ +pragma \ query \ readonly \ relationship \ relationship-query \ schema \ template \ +types \ view \ wrapper diff --git a/common/pragma/driver.cxx b/common/pragma/driver.cxx new file mode 100644 index 0000000..65b384d --- /dev/null +++ b/common/pragma/driver.cxx @@ -0,0 +1,27 @@ +// file : common/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/common/pragma/makefile b/common/pragma/makefile new file mode 100644 index 0000000..449fcaf --- /dev/null +++ b/common/pragma/makefile @@ -0,0 +1,108 @@ +# file : common/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) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +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) + +# 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) + +genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) $(odb_hdr:.hxx=.sql) +gen := $(addprefix $(out_base)/,$(genf)) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --database $(db_id) \ +--table-prefix pragma_ +$(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 +# +name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) + +$(dist): db_id := @database@ +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(name) +$(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ +$(call vc10projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call message,test $<,$< --options-file $(dcf_root)/db.options \ +>$(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) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/pragma/test.hxx b/common/pragma/test.hxx new file mode 100644 index 0000000..d7f21b0 --- /dev/null +++ b/common/pragma/test.hxx @@ -0,0 +1,42 @@ +// file : common/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 ("INTEGER") + +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 ("INTEGER") + 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/common/pragma/test.std b/common/pragma/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/types/driver.cxx b/common/types/driver.cxx new file mode 100644 index 0000000..11e15d7 --- /dev/null +++ b/common/types/driver.cxx @@ -0,0 +1,37 @@ +// file : common/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 + +#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/common/types/makefile b/common/types/makefile new file mode 100644 index 0000000..4081ee8 --- /dev/null +++ b/common/types/makefile @@ -0,0 +1,107 @@ +# file : common/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) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +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) + +# 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) + +genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) $(odb_hdr:.hxx=.sql) +gen := $(addprefix $(out_base)/,$(genf)) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --database $(db_id) --table-prefix 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 +# +name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) + +$(dist): db_id := @database@ +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(name) +$(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ +$(call vc10projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call message,test $<,$< --options-file $(dcf_root)/db.options \ +>$(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) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/types/test.hxx b/common/types/test.hxx new file mode 100644 index 0000000..858f403 --- /dev/null +++ b/common/types/test.hxx @@ -0,0 +1,57 @@ +// file : common/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 + +#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; // Name that we should not use. +#endif + + num_wrap () {} + num_wrap (X v): v_ (v) {} + operator X () const {return v_;} + + X v_; +}; + +#pragma db object +struct object3 +{ + #pragma db id type("INTEGER") + num_wrap num_; +}; + +#endif // TEST_HXX diff --git a/common/types/test.std b/common/types/test.std new file mode 100644 index 0000000..e69de29 diff --git a/configure.ac b/configure.ac index ff877d8..26ae26d 100644 --- a/configure.ac +++ b/configure.ac @@ -7,7 +7,7 @@ AC_PREREQ(2.60) AC_INIT([odb-tests], [__value__(version)], [odb-users@codesynthesis.com]) AC_CONFIG_AUX_DIR([config]) AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_SRCDIR([tracer/template/driver.cxx]) +AC_CONFIG_SRCDIR([common/template/driver.cxx]) AM_INIT_AUTOMAKE([-Wall -Werror foreign nostdinc subdir-objects dist-bzip2 dist-zip tar-ustar]) @@ -33,7 +33,6 @@ AM_CONDITIONAL([ODB_TESTS_THREADS], [test x$threads != xnone]) # Check for the ODB libs. # LIBODB([], [AC_MSG_ERROR([libodb is not found; consider using --with-libodb=DIR])]) -LIBODB_TRACER([], [AC_MSG_ERROR([libodb-tracer is not found; consider using --with-libodb-tracer=DIR])]) # Check for TR1 availability. # diff --git a/m4/libodb-tracer.m4 b/m4/libodb-tracer.m4 deleted file mode 100644 index 4cc2265..0000000 --- a/m4/libodb-tracer.m4 +++ /dev/null @@ -1,84 +0,0 @@ -dnl file : m4/libodb-tracer.m4 -dnl author : Boris Kolpackov -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl LIBODB_TRACER([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -dnl -AC_DEFUN([LIBODB_TRACER], [ -libodb_tracer_found=no - -AC_ARG_WITH( - [libodb-tracer], - [AC_HELP_STRING([--with-libodb-tracer=DIR],[location of libodb-tracer build directory])], - [libodb_tracer_dir=${withval}], - [libodb_tracer_dir=]) - -AC_MSG_CHECKING([for libodb-tracer]) - -# If libodb_tracer_dir was given, add the necessary preprocessor and -# linker flags. -# -if test x"$libodb_tracer_dir" != x; then - save_CPPFLAGS="$CPPFLAGS" - save_LDFLAGS="$LDFLAGS" - - AS_SET_CATFILE([abs_libodb_tracer_dir], [$ac_pwd], [$libodb_tracer_dir]) - - CPPFLAGS="$CPPFLAGS -I$abs_libodb_tracer_dir" - LDFLAGS="$LDFLAGS -L$abs_libodb_tracer_dir/odb/tracer" -fi - -save_LIBS="$LIBS" -LIBS="-lodb-tracer $LIBS" - -CXX_LIBTOOL_LINK_IFELSE( -AC_LANG_SOURCE([[ -#include - -void -f () -{ -} - -const char* -g () -{ - try - { - f (); - } - catch (const odb::tracer::database_exception& e) - { - return e.what (); - } - return 0; -} - -int -main () -{ - const char* m (g ()); - return m != 0; -} -]]), -[libodb_tracer_found=yes]) - -if test x"$libodb_tracer_found" = xno; then - LIBS="$save_LIBS" - - if test x"$libodb_tracer_dir" != x; then - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - fi -fi - -if test x"$libodb_tracer_found" = xyes; then - AC_MSG_RESULT([yes]) - $1 -else - AC_MSG_RESULT([no]) - $2 -fi -])dnl diff --git a/makefile b/makefile index 2007852..1e94b3a 100644 --- a/makefile +++ b/makefile @@ -5,8 +5,8 @@ include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make -all_dirs := libcommon common tracer mysql sqlite pgsql oracle boost qt -dirs := common tracer boost qt +all_dirs := libcommon common mysql sqlite pgsql oracle boost qt +dirs := common boost qt ifeq ($(db_id),mysql) dirs += mysql @@ -23,8 +23,8 @@ endif # @@ Remove overrides when Oracle implementation is complete. # ifeq ($(db_id),oracle) -all_dirs := libcommon common tracer mysql sqlite pgsql oracle boost -dirs := common tracer boost oracle +all_dirs := libcommon common mysql sqlite pgsql oracle boost +dirs := common boost oracle endif default := $(out_base)/ @@ -45,7 +45,7 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_dirs))) $(call dist-data,$(data_dist)) $(call dist-exec,$(exec_dist)) $(call dist-dir,m4) - $(call meta-vctest,tracer/tracer-vc10.sln,build.bat) + $(call meta-vctest,libcommon/libcommon-mysql-vc10.sln,build.bat) $(call meta-automake) $(call meta-autoconf) diff --git a/test.bat b/test.bat index 97f52bb..c3355e0 100644 --- a/test.bat +++ b/test.bat @@ -39,7 +39,7 @@ goto :eof :start -for %%d in (tracer common %1 boost\common boost\%1 qt\common qt\%1) do ( +for %%d in (common %1 boost\common boost\%1 qt\common qt\%1) do ( call :run_test %%d %1 ) 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